Card
Container for grouped content
Overview
Card is a compound component made up of seven named sub-components. Compose them freely to build content cards, settings panels, stat blocks, or any container that benefits from structured sections. All sub-components extend the native <div> element and accept className for overrides.
Usage
import { Card } from "@leanicon/web-builder-library";
<Card>
<Card.Header>
<Card.Title>Title</Card.Title>
<Card.Description>Description</Card.Description>
</Card.Header>
<Card.Content>Content</Card.Content>
<Card.Footer>Footer</Card.Footer>
</Card>;Variants
Basic card
Pro — $49 / month
Card with action in header
CardAction anchors to the top-right corner of CardHeader using CSS grid. Use it for a button, badge, or dropdown trigger.
Member list goes here.
Card with footer
All your data will be removed within 30 days.
Minimal — content only
A simple card with no header or footer.
Sub-component summary
Component | Role |
|---|---|
| Root container — rounded border, shadow, vertical flex gap |
| Top region with CSS grid layout supporting an optional action |
| Semibold heading inside the header |
| Muted subtitle beneath the title |
| Top-right slot inside |
| Main content area with horizontal padding |
| Bottom region — flex row, useful for action buttons |
Notes
Card.Actiononly positions correctly when placed as a direct child ofCard.Header. Do not nest it deeper.- Dark mode is supported automatically through
bg-cardandtext-card-foregroundtokens. - Add
border-btoCardHeaderorborder-ttoCardFooterto get auto-padded dividers ([.border-b]:pb-6/[.border-t]:pt-6are built in).