ListRow

Rows: date tile, navigation, key-value, person.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/list-row.json

Variants and group header

4 variants + the group header. Nothing else exists. One card never mixes date rows and person rows. Heights: date 72 · person 64 · key-value 56 · nav 56 · group 40.

Akan datang & menunggu HR · 1
30DesCuti tahunan · Rabu–Kamis, 30–31 Des2 hari · diajukan Rabu, 16 DesMenunggu HR
Riwayat · 2
16DesCuti tahunan · Rabu, 16 Des1 hari · disetujui Faiz Intifada, 12 DesDisetujui
3JulCuti tahunan · Jumat, 3 Jul1 hari · dibatalkan oleh Anda, 1 JulDibatalkan
Lihat semua permintaan
Fajar Nugroho · Cuti sakitJumat, 18 Des · 1 hariMenunggu HR
Dimas Pratama · Cuti tahunanRabu, 16 Des · 1 hariDisetujui
Telepon0813 2045 7781
Golongan darah–
Semua hari libur

Interactive and selected

hover bg-accent 150 ms · pressed bg-muted · focus-visible inset 2px ring · selected bg-muted (grey, no hue: colour never marks the chosen row). Key-value and group rows never react.

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

DoGroup by what the user does next"Akan datang & menunggu HR · 1" above "Riwayat · 5": the one row that may still need "Batalkan" comes first.
Don'tBlue 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.

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

API

import { ListRow, ListGroupHeader } from "@/components/mahr/list-row"
PropTypeDefaultDescription
variant"date" | "person" | "keyValue" | "nav"–Required. Closed set.
title · metaReactNode · 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 · actionReactNode · ReactNode–Trailing slots, in this order. Max one Button.
href · render · onClickstring · ReactElement · fn–nav and date rows. <a href> by default; render={<Link href=… />} for your router.
selected · mutedboolean · booleanfalse · falseselected = current item; muted = past or cancelled.
<ListGroupHeader>label: string; count?: number–Renders "label · count".