ComponentsData Display
Card
A flexible container for grouping related content and actions.
Overview
A card groups related content and actions into a single surface. Compose it from
CardHeader, CardTitle, CardDescription, CardContent, and CardFooter.
$ npx morpha-ui add cardExamples
With action
Use CardAction to place a control (such as a button) in the top-right of the header.
Installation
Morpha UI components are distributed via the Morpha CLI (coming in a later
step): npx morpha-ui add card. In the meantime, since this is the base
shadcn component, you can also add it directly:
npx shadcn@latest add cardAPI Reference
The Card root accepts a size prop plus standard <div> attributes. The
sub-components — CardHeader, CardTitle, CardDescription, CardAction,
CardContent, and CardFooter — are layout wrappers that forward <div> props.
Prop
Type
Accessibility
- Use the full composition so structure is conveyed: title in
CardTitle, supporting text inCardDescription. - Place a semantic heading inside
CardTitlewhen the card titles a region of the page. CardContentandCardFooterare generic containers — keep interactive controls keyboard reachable.