BackButton

The link back from a record to its list.

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

Header row of a detail page

The ONE navigation exception (DESIGN.md rule 3): a real link that looks like a secondary 44 pill with a chevron-left (padding 14 / 20, gap 6). It opens in a new tab with Cmd/Ctrl-click. Right side: "Karyawan 1 dari 48" + prev / next IconButtons (disabled at the ends) + the more menu.

Semua karyawan
Karyawan 1 dari 48

When to use

  • The top left of a detail page, to go back to its list: "‹ Semua karyawan" (Karyawan · Detail).
  • Once per page, in the header row, with the record position and prev / next on the right.

When not to use

  • Any other navigation (a card footer, a row) → ListRow nav or CardFooterLink (dark text + grey chevron).
  • Going between top-level pages → the rail.
  • An action (save, open a panel) → Button.

Do and don't

DoSay where it goes"Semua karyawan", the list's name. The user knows the target before the click.
Don't"Kembali" or a Button with router.back()"Kembali" hides the target, and history.back() can leave the app when the page was opened from a link. Always an href to the list.

Installation

Add BackButton 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/back-button.json

API

import { BackButton } from "@/components/mahr/back-button"
PropTypeDefaultDescription
hrefstring–The list URL. Keep its query (tab, search, page) so the user returns to the same place.
renderReactElement–Your router link: render={<Link href="/karyawan" />}.
childrenstring–"Semua" + the list name.