Skip to main content

Common Examples

To use the Card, 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 href and onPress for a static <div>.
  • Pass href and a required label for a link card.
  • Pass onPress and a required label for a button card.
Passing both 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

The padding prop supports "snug", "base" (default), and "relaxed".

Disabled button cards

Only the button card supports isDisabled. Link cards do not expose a disabled state.

React Accessibility

  • Interactive cards require label, which names both the whole-card action and its role="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.
Last modified on August 28, 2026