Skip to main content

Card

The base surface for grouping content.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When 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​

PropTypeRequiredDescription
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".
hrefstring—Make the whole card a link, routed through LinkProvider.
linkComponentLinkComponent—Overrides LinkProvider's link component for this card.
paddedboolean—Apply internal padding. Default true.
isInteractiveboolean—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.
isSelectedboolean—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.
isHighlightedboolean—Just arrived (live updates): a brief glow, or a static ring with reduced motion.
isLiftedboolean—For a linked card (href or CardAction): a slight rise and deeper shadow on hover and keyboard focus. No movement under prefers-reduced-motion.
isDisabledboolean—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) =&gt; void—Fired on click, Enter or Space when interactive / selectable.
childrenReact.ReactNode—
classNamestring—