Card
Groups related content and actions on one surface.
Installation
pnpm dlx shadcn@latest add @paneui/cardUsage
Composition
Examples
Card
Also accepts every prop of div.
- size= "default"
- "sm" | "default" | "lg"
- Sets
--card-spacing(12, 16 or 24px), used by every part for padding and gaps. - interactive= false
- boolean
- The whole card is one link or button: the shadow steps up on hover and focus shows the ring.
- render
- React.ReactElement | (props, state) => React.ReactElement
- Render the card as another element, such as
<a href>or your router's link. - variant= "default"
- "default" | "outline" | "ghost" | "inset"
outlineis a 1px border with no fill or shadow,ghosthas no surface, andinsetturns the card into a tinted frame (4px padding) that holds aCardPanel.
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "sm" | "default" | "lg" | "default" | Sets --card-spacing (12, 16 or 24px), used by every part for padding and gaps. |
| interactive | boolean | false | The whole card is one link or button: the shadow steps up on hover and focus shows the ring. |
| render | React.ReactElement | (props, state) => React.ReactElement | — | Render the card as another element, such as <a href> or your router's link. |
| variant | "default" | "outline" | "ghost" | "inset" | "default" | outline is a 1px border with no fill or shadow, ghost has no surface, and inset turns the card into a tinted frame (4px padding) that holds a CardPanel. |
- data-size
- The
sizevalue. - data-variant
- The
variantvalue.
| Data attribute | Description |
|---|---|
| data-size | The size value. |
| data-variant | The variant value. |
CardHeader
Title, description and an optional CardAction in the top-right corner. Also accepts every prop of div.
CardAction
Placed in the header's right column, spanning the title and description rows. Also accepts every prop of div.
CardContent
Also accepts every prop of div.
- typeset= false
- boolean | "docs" | "reading" | "chat"
- Turn prose styles back on for the content inside a
typesetcontainer, or name a preset when it stands alone.
| Prop | Type | Default | Description |
|---|---|---|---|
| typeset | boolean | "docs" | "reading" | "chat" | false | Turn prose styles back on for the content inside a typeset container, or name a preset when it stands alone. |