elementscard
Card
Structured content container with optional header, body, footer, and action slots.
Import#
Slot Structure#
Structured content container with optional header, body, and footer sections.
Examples#
Default#
Create project form card from coss/ui.
Sizes#
Default and compact size presets.
With Image#
Media-first card using body slot customization.
Header Action#
Custom action area inside the header slot.
API Reference#
Attributes#
Slot
root0 attributesCard container that frames the header, body, and footer regions.
No attribute metadata for this slot.
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| action | JSX.Element | — | Content to render in the action slot (usually a button in the header). |
| children | JSX.Element | — | Children of the card. |
| class | ClassValue | — | Class applied to the component root or trigger element. |
| classes | CardT.Classes | undefined | — | — |
| compact | boolean | undefined | false | Whether to use a compact layout. |
| description | JSX.Element | — | Description of the card. |
| footer | JSX.Element | — | Content to render in the footer slot. |
| header | JSX.Element | — | Content to render in the header slot, overrides title/description. |
| ref | JSX.HTMLElementTags["div"] extends { ref?: infer Ref; } ? Ref : never | undefined | — | — |
| style | JSX.CSSProperties | undefined | — | — |
| styles | CardT.Styles | undefined | — | — |
| title | JSX.Element | — | Title of the card. |