ListRow
Rows: date tile, navigation, key-value, person.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/list-row.jsonVariants and group header
30Cuti tahunan · Rabu–Kamis, 30–31 Des
16Cuti tahunan · Rabu, 16 Des
3Cuti tahunan · Jumat, 3 Jul
Lihat semua permintaanFajar Nugroho · Cuti sakit
Dimas Pratama · Cuti tahunan
Interactive and selected
When to use
- Lists of 6 rows or fewer per group: Permintaan saya, Hari libur, Semua slip.
- Card footers that go somewhere: "Lihat semua permintaan", "Semua hari libur".
- Read-only record data: Data pribadi, Rekening & pajak (key-value).
- People lists on employee screens: Tim saya, Rekan satu tim.
When not to use
- More than 6 records compared by column, with sort or pager → Table.
- A grid of people with photos → PersonCard.
- An action that changes data → a Button inside the row, never the whole row.
- An empty list → EmptyState in the card body, not an empty row.
Do and don't
Group by what the user does next"Akan datang & menunggu HR · 1" above "Riwayat · 5": the one row that may still need "Batalkan" comes first.
Blue links for navigation, buttons on every row"Lihat semua" in blue reads as an action that changes data. Row actions go in one DropdownMenu or to the detail page.
Installation
Add ListRow 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 { ListRow, ListGroupHeader } from "@/components/mahr/list-row"| Prop | Type | Default | Description |
|---|---|---|---|
variant | "date" | "person" | "keyValue" | "nav" | – | Required. Closed set. |
title · meta | ReactNode · ReactNode | – | keyValue: title = label, meta = value (null/"" → "–"). |
date | { date, tone?, module? } | – | variant="date" only. Renders a DateTile. |
person | { name; avatarUrl? } | – | variant="person" only. Avatar 40. |
badge · action | ReactNode · ReactNode | – | Trailing slots, in this order. Max one Button. |
href · render · onClick | string · ReactElement · fn | – | nav and date rows. <a href> by default; render={<Link href=… />} for your router. |
selected · muted | boolean · boolean | false · false | selected = current item; muted = past or cancelled. |
<ListGroupHeader> | label: string; count?: number | – | Renders "label · count". |