Card
Fiddlesurface-card) with standard padding.Custom domaindocs.acme.dev
Usage
The import, then a use to start from. Both copy as they are.
Import
import Card from "@/components/ui/card";Example
<Card className="flex-col gap-2"> <h3 className="text-subheading">Custom domain</h3> <p className="text-muted text-sm">Serve your docs from your own URL.</p></Card>When to use
Use it for
- The framed surface:
surface-card, with padding that grows with the screen. - It's a flex row with
gap-6; addflex-colfor stacked content. - One concern per card, with its title first.
Avoid
- Cards inside cards. Inside one, separate with a hairline (
border-default) orsurface-inset. - A card per row of a list: a list is rows with hairlines between them.
Accessibility
Checks
- A card that links somewhere is one link: the title is the
Link, stretched over the card, with no buttons nested in it.
API
Read from each component's stories, the same source as COMPONENTS.md, and kept in step by check:design-system.
Card
Its stories don't declare
argTypes, so no props are listed. The variants show its states.VariantsDefaultWithCustomStyle
Keep going
- MetricsCardA stat tile: title, counted value, change and refresh state.Fiddle
- Settings cardsOne card per concern with its own Save; destructive actions last.Understory
Surfaces
Introduce layering of components with ease.