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 — conteneur générique pour du contenu regroupé (utilisateur, produit, tableau de stats). Bordure + fond + padding + shadow-sm.
Composition idiomatique : CardHeader (Title + Description) → CardContent (corps) → 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>...corps libre...</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 | — | text-lg font-semibold leading-none tracking-tight. |
CardDescription
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | text-sm text-muted-foreground. |
CardContent
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | p-6 pt-0 par défaut. |
CardFooter
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | flex items-center p-6 pt-0. |
Accessibility
Card est un container visuel — aucun rôle ARIA nécessaire. Si la card entière est cliquable, wrapper dans <a> ou <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