Skip to main content

CardAction

The real button or link of a clickable card.

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

When to use​

The real button or link of a clickable card.

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-action
import { CardAction } from '@/components/prism/CardAction';

In a no-build prototype, read it from the bundle instead: const { CardAction } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
hrefstring—Makes it a link (through LinkProvider).
linkComponentLinkComponent—Overrides LinkProvider's link component.
onPress(e: React.MouseEvent&lt;HTMLButtonElement&gt;) =&gt; void—Makes it a <button>; fired on click, Enter or Space. Client components only.
isDisabledboolean—An unavailable option: a button becomes disabled; a link drops its href and is aria-disabled. The card greys out. Put the reason in the card and point at it with aria-describedby.
childrenReact.ReactNode—
classNamestring—