- Implementation
- Card Props
Common Examples
To use theCard, import it from @servicetitan/anvil2-ai-kit and pass content through the required content prop. The kit forbids children.Card type
Props select one of three card types:- Omit
hrefandonPressfor a static<div>. - Pass
hrefand a requiredlabelfor a link card. - Pass
onPressand a requiredlabelfor a button card.
href and onPress is a type error.Interactive cards
Interactive cards use a stretched action over the surface. Content remains a sibling of that action, so it can include its own buttons and links without nesting interactive elements.Padding
Thepadding prop supports "snug", "base" (default), and "relaxed".Disabled button cards
Only the button card supportsisDisabled. Link cards do not expose a disabled state.React Accessibility
- Interactive cards require
label, which names both the whole-card action and itsrole="group"container. - Nested controls remain separate DOM siblings above the stretched action, avoiding nested-interactive violations.
- Link cards activate with Enter. Button cards activate with Enter or Space.