Skip to content

Card

Download .md

A card groups related content, such as one release or one document, on its own surface.

  • Use it for a self-contained item with a title and, often, actions.
  • Use plain sections, not cards, to split one long form or page.
  • Don’t nest cards inside cards.
React
Rilis baru
Single "Senja di Kota" siap dikirim ke semua platform.

Periksa metadata dan artwork sebelum kamu kirim.

Vue

Rilis baru

Single "Senja di Kota" siap dikirim ke semua platform.

Periksa metadata dan artwork sebelum kamu kirim.

DoSeparate cards from the page with a border.
Don'tDon't lift every card with a shadow; save shadows for what floats over the page.
123
  1. 1Header: title and description
  2. 2Content
  3. 3Footer with actions

Header (title, description, optional action), content, then footer with actions. The card sits on card with a border and radius-lg (12px). It has no shadow by default: a border separates it from the page. Add shadow-md only for a card that floats, such as the header card of the dashboard.

There is one style. Pass shadow-md for a floating card.

React Vue Flutter Type Default Use
CardHeader, CardTitle, CardDescription same names title, description element none The heading area.
CardContent CardContent child element none The body.
CardFooter CardFooter footer element none Actions.
className class width, padding string none Size and floating shadow.
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
export default function CardDemo() {
return (
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle>Rilis baru</CardTitle>
<CardDescription>Single "Senja di Kota" siap dikirim ke semua platform.</CardDescription>
</CardHeader>
<CardContent>
<p className="text-sm text-muted-foreground">Periksa metadata dan artwork sebelum kamu kirim.</p>
</CardContent>
<CardFooter className="gap-2">
<Button>Kirim</Button>
<Button variant="outline">Periksa dulu</Button>
</CardFooter>
</Card>
)
}
Terminal window
npx shadcn@latest add https://design.sosialoka.tech/r/react/card.json
  • A card is a plain container; give its title a real heading level in your page when it starts a section.
  • Keep one main action per card, so the footer reads clearly.