CardAction
The real button or link of a clickable card.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen 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
| Prop | Type | Required | Description |
|---|---|---|---|
href | string | — | Makes it a link (through LinkProvider). |
linkComponent | LinkComponent | — | Overrides LinkProvider's link component. |
onPress | (e: React.MouseEvent<HTMLButtonElement>) => void | — | Makes it a <button>; fired on click, Enter or Space. Client components only. |
isDisabled | boolean | — | 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. |
children | React.ReactNode | — | |
className | string | — |