Card
A white raised surface for one unit of data.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/card.jsonHeader, body, footer
Kontak darurat
Sari Pratiwi
Group headers
Permintaan saya
Cuti tahunan · Rabu–Kamis, 30–31 Des
Cuti tahunan · Rabu, 16 Des
Lihat semua permintaanWhen to use
- One unit of related data: Kontak darurat, Pekerjaan, Permintaan saya.
- A list of rows that belong together, split by group header strips.
- The frame of composites: StatTile, DetailCard, ProfileCard.
When not to use
- Many records with columns → Table.
- A note or warning inside a card → Callout.
- A floating layer → Sheet, Dialog or DropdownMenu.
- A clickable tile → a ListRow or a button inside the card; the card itself never reacts.
Do and don't
Make the rows the targetsRows, the footer link and buttons have hover and focus. The card has none.
A primary in the card header, or a border around the cardThe header action is secondary or blue text. A card's edge is its shadow; a 1 px border makes a double edge.
Installation
Add Card with the shadcn CLI (your project needs a components.json and the MaHR theme: https://mahrdesign.faizintifada.com/r/theme.json), or copy the files by hand.
API
import { Card, CardHeader, CardContent, CardGroupHeader, CardFooterLink } from "@/components/ui/card"| Prop | Type | Default | Description |
|---|---|---|---|
CardHeader title · description | ReactNode | – | Title 18/24 strong; description 14/20 muted. |
CardHeader action | ReactNode | – | Secondary Button, link Button, or lock + "Diatur oleh HR". Never primary. |
CardHeader icon | ReactNode | – | Optional module icon tile at the left. |
CardContent | div | – | Padding 0 20 20. |
CardGroupHeader label · count | ReactNode · number | – | Sunken strip between row groups. |
CardFooterLink href · render | string · ReactElement | – | 56 high navigation row; dark text + grey chevron. <a> by default; pass render={<Link href=… />} for your router (no Next.js import inside the component). |