Card

A white raised surface for one unit of data.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/card.json

Header, body, footer

White, radius 16, shadow-card. Header title 18/24 strong + optional description + one right action (secondary button, blue text, or the lock note). Footer = navigation row with a grey chevron.

Kontak darurat

Sari PratiwiIstri · 0812 7730 1945

Pekerjaan

Diatur oleh HR
Backend engineer · Engineering
Lihat profil saya

Group headers

A sunken strip (bg-muted, 40 high) with "label · count" groups the rows.

Permintaan saya

6 permintaan di tahun 2026

Akan datang & menunggu HR · 1
Cuti tahunan · Rabu–Kamis, 30–31 DesMenunggu HR
Riwayat · 5
Cuti tahunan · Rabu, 16 DesDisetujui
Lihat semua permintaan

When 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

DoMake the rows the targetsRows, the footer link and buttons have hover and focus. The card has none.
Don'tA 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.

terminal
bunx --bun shadcn@latest add https://mahrdesign.faizintifada.com/r/card.json

API

import { Card, CardHeader, CardContent, CardGroupHeader, CardFooterLink } from "@/components/ui/card"
PropTypeDefaultDescription
CardHeader title · descriptionReactNode–Title 18/24 strong; description 14/20 muted.
CardHeader actionReactNode–Secondary Button, link Button, or lock + "Diatur oleh HR". Never primary.
CardHeader iconReactNode–Optional module icon tile at the left.
CardContentdiv–Padding 0 20 20.
CardGroupHeader label · countReactNode · number–Sunken strip between row groups.
CardFooterLink href · renderstring · 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).