Examples
Simple content
A bounded surface gives one related idea a clear visual home.
Usage this month
Keep the summary and its next action together.
18,420 events
12% more than last month.
Card with header, description, and content
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@phuctech/ui/components/card";
export function Example() {
return (
<Card>
<CardHeader>
<CardTitle>Usage this month</CardTitle>
<CardDescription>Keep the summary and its next action together.</CardDescription>
</CardHeader>
<CardContent>18,420 events</CardContent>
</Card>
);
}
Grouped actions
Actions remain real buttons or links in the footer.
Draft release
Two actions with clear emphasis.
Card with grouped actions
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@phuctech/ui/components/card";
export function Example() {
return (
<Card>
<CardHeader>
<CardTitle>Usage this month</CardTitle>
<CardDescription>Keep the summary and its next action together.</CardDescription>
</CardHeader>
<CardContent>18,420 events</CardContent>
</Card>
);
}Form surface
Cards can frame a form while Field keeps labels and validation connected.
Invite a teammate
Send an invitation to the workspace.
Card framing a form
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@phuctech/ui/components/card";
export function Example() {
return (
<Card>
<CardHeader>
<CardTitle>Usage this month</CardTitle>
<CardDescription>Keep the summary and its next action together.</CardDescription>
</CardHeader>
<CardContent>18,420 events</CardContent>
</Card>
);
}Long content
Long lists use their own scroll region instead of clipping the surface.
Recent activity
Card with bounded long content
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@phuctech/ui/components/card";
export function Example() {
return (
<Card>
<CardHeader>
<CardTitle>Usage this month</CardTitle>
<CardDescription>Keep the summary and its next action together.</CardDescription>
</CardHeader>
<CardContent>18,420 events</CardContent>
</Card>
);
}When to use
Use Card for a related set of content that benefits from a visual boundary. Use a plain section when grouping alone is enough, and use a Dialog when the task needs a temporary modal surface.
Usage
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@phuctech/ui/components/card";
export function Example() {
return (
<Card>
<CardHeader>
<CardTitle>Usage this month</CardTitle>
<CardDescription>Keep the summary and its next action together.</CardDescription>
</CardHeader>
<CardContent>18,420 events</CardContent>
</Card>
);
}
Composition
Use CardHeader for the title and description, CardContent for the primary information, and CardFooter for actions. Omit a region when it does not apply; do not add empty padding wrappers.
Keep one primary heading and place the next action in the footer.
Do not nest a full page, unrelated cards, or long unbounded lists inside one Card.
API
Tokens
Accessibility
- Use a heading inside a Card when it introduces a distinct region.
- Keep actions as real buttons or links; the Card itself is not interactive by default.
- Long content needs its own bounded, scrollable region rather than clipping the Card.
Do and don’t
Use Card to make related content easier to scan and keep its heading hierarchy intact.
Use nested borders to imitate a table or make every paragraph look like a separate surface.