Card
A surface that groups related content. The padding is a density rather than a class, so cards are the same size wherever they appear.
Reach for it
Grouping related content on its own surface.
Not for
Wrapping a single control, where the border is decoration.
Densities
Comfortable is the default and suits anything with a heading. Compact belongs in lists and pickers, spacious in a card that stands alone on a page, and flush in one whose content manages its own edges. isInteractive adds the hover and focus treatment for a card that is a control.
Comfortable
The default. Used for anything with a heading.
Compact, interactive
Hover it. Used in lists and pickers.
Spacious
For a card that stands alone on a page.
No padding
For content that manages its own edges.
API reference
Card
| Prop | Type | Default | Description |
|---|---|---|---|
| density | 'flush' | 'compact' | 'comfortable' | 'spacious' | comfortable | How much room the content is given. A density rather than a padding: the caller is choosing how the card should feel, not setting a CSS property. `flush` is for a card whose content owns its own edges, a table or a tab strip. |
| isInteractive | boolean | false |
Also takes the standard attributes of a div, minus className and style.
CardHeader
| Prop | Type | Default | Description |
|---|---|---|---|
| children* | ReactNode | - |
CardTitle
| Prop | Type | Default | Description |
|---|---|---|---|
| children* | ReactNode | - | |
| id | string | - |
CardDescription
| Prop | Type | Default | Description |
|---|---|---|---|
| children* | ReactNode | - |