Card
The base surface for grouping content.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
The base surface for grouping content.
Accessibility
Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.
Install and import
npx shadcn@latest add @prism/card
import { Card } from '@/components/prism/Card';
In a no-build prototype, read it from the bundle instead: const { Card } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
variant | "inset" | — | "inset": flatter and tighter, for a card inside a card. |
as | "div" | "section" | "article" | "aside" | "form" | "fieldset" | "li" | "header" | "footer" | React.ElementType | — | The element (or component) to render. Default "div". |
href | string | — | Make the whole card a link, routed through LinkProvider. |
linkComponent | LinkComponent | — | Overrides LinkProvider's link component for this card. |
padded | boolean | — | Apply internal padding. Default true. |
isInteractive | boolean | — | Make the whole card a keyboard-focusable button target (div role="button"). Screen readers flatten a heading inside it — prefer a <CardAction> around the title instead. |
isSelected | boolean | — | Make it a choice card (implies interactive). Selected cards get an accent ring and a check mark. States itself with aria-pressed, or aria-checked when role is "radio" / "checkbox" — for one-of-many choices, wrap the cards in role="radiogroup" and pass role="radio". |
tone | "accent" | "info" | "positive" | "notice" | "negative" | — | An intent edge on the inline-start side, to set the card apart. |
hue | "rose" | "orange" | "amber" | "green" | "teal" | "blue" | "violet" | "magenta" | — | A categorical identity (a module, a category): a band across the top, and the accent inside the card (buttons, links, focus, icons) follows the hue. |
isHighlighted | boolean | — | Just arrived (live updates): a brief glow, or a static ring with reduced motion. |
isLifted | boolean | — | For a linked card (href or CardAction): a slight rise and deeper shadow on hover and keyboard focus. No movement under prefers-reduced-motion. |
isDisabled | boolean | — | An unavailable option (with isInteractive, isSelected or href): greyed out, aria-disabled, out of the tab order, onPress never fires, a linked card loses its href. Explain why in the card and reference it with aria-describedby. |
onPress | (e: React.SyntheticEvent) => void | — | Fired on click, Enter or Space when interactive / selectable. |
children | React.ReactNode | — | |
className | string | — |