Card

A container that groups related content and actions in a bordered, elevated surface.

$bunx shadcn@latest add @nx-ui/card
Registry item
Installs withutils

Basic usage

Header, content and footer slots compose into a single bordered surface.

Elmswell composting site
Weekly intake summary for the anaerobic digestion facility.

412 tonnes of green waste processed this week, tracking 6% ahead of the seasonal forecast.

Header with action

CardAction anchors a control to the top-right of the header grid, alongside a title and description.

Riverside allotments
Community growing project

Soil health checks are due before the fourteen plots are handed back to members for the autumn planting round.

Sizes

The default card uses generous spacing; the sm size tightens padding for dense layouts.

Default spacing
size="default"

Used for standalone cards and feature panels across the dashboard.

Compact spacing
size="sm"

Suited to grids of cards, such as a list of organisations or collection rounds.

Loading state

While data loads, mirror the eventual layout with skeleton placeholders rather than a spinner.

Composition: project card

Cards combine freely with badges, avatars and progress to build realistic dashboard tiles.

Beckvale organics collection
Kerbside food waste rollout, phase two
On track
Beckvale Borough Council18 rounds/weekOrganics stream
Households onboarded
x
JBMORS
412t diverted

API reference

Exported parts and their props, extracted from the component source.