Card
Displays a card with header, content, and footer.
Create project
Deploy your new project in one-click.
>Name: >my-app
>Framework: >Next.js
Card is a generic container for grouped content (a user, a product, a stats table). Border, background, padding and shadow-sm.
Idiomatic composition: CardHeader (Title + Description) → CardContent (body) → CardFooter (actions).
Installation
$ bext ui add card
Copy and paste the following into src/components/ui/card.tsx.
Usage
Anatomy
<Card> ├── <CardHeader> │ ├── <CardTitle>...</CardTitle> │ └── <CardDescription>...</CardDescription> ├── <CardContent>...free-form body...</CardContent> └── <CardFooter>...actions...</CardFooter>
API Reference
Card
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | rounded-xl border bg-card text-card-foreground shadow-sm. |
CardHeader
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | flex flex-col gap-1.5 p-6. |
CardTitle
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | <h3> text-lg font-semibold leading-none tracking-tight. |
CardDescription
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | <p> text-sm text-muted-foreground. |
CardContent
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | p-6 pt-0 by default. |
CardFooter
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | flex items-center p-6 pt-0. |
Accessibility
Card is a visual container and needs no ARIA role. If the whole card is clickable, wrap it in an <a> or a <button>.
Edit this example live in the bext playground. It compiles and runs entirely in your browser.
The React idiom: same UI, for comparison.
On This Page