Displays a card with header, content, and footer.
Installation
Usage
<Card>
<CardHeader>
<CardTitle>Card Title</CardTitle>
<CardDescription>Card Description</CardDescription>
<CardAction>Card Action</CardAction>
</CardHeader>
<CardContent><p>Card Content</p></CardContent>
<CardFooter><p>Card Footer</p></CardFooter>
</Card>Composition
Use the following composition to build a Card:
Card
├── CardHeader
│ ├── CardTitle
│ ├── CardDescription
│ └── CardAction
├── CardContent
└── CardFooterSize
Use the size="sm" parameter to set the size of the card to small. The small size variant uses smaller spacing.
Spacing
In addition to the Size parameter, you can use the --card-spacing CSS variable to control the spacing between sections and the inset of card parts.
Use negative margins with -mx-(--card-spacing) to make content go edge to edge while keeping it aligned with the card inset. When the edge-to-edge content sits above a footer, use -mb-(--card-spacing) on CardContent to remove the section gap.
Image
Add an image before the card header to create a card with an image.
RTL
To enable RTL support in Blazix, see the RTL configuration guide.
Translated with AI for the demo, so it may have mistakes.
API Reference
Card
Other attributes are passed to the element it renders.
CardAction
Other attributes are passed to the element it renders.
CardContent
Other attributes are passed to the element it renders.
CardDescription
Other attributes are passed to the element it renders.
CardFooter
Other attributes are passed to the element it renders.
CardHeader
Other attributes are passed to the element it renders.
CardTitle
Other attributes are passed to the element it renders.
Changelog
Spacing Variable
The card's padding and gaps come from the --card-spacing variable. Customize them by setting --card-spacing on the Card with an arbitrary property class:
<Card Class="[--card-spacing:--spacing(6)]">...</Card>