AppShell
Rail + top bar + page background.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/app-shell.jsonEmployee
Cuti saya
PT Mencari Cinta
Saldo tahun 2026 · semua cuti disetujui oleh HR
Admin
Pengaturan
Cuti count (motion)
Ringkasan
When to use
- Every page after login, for all 4 roles (Admin, HR, Manager, Karyawan).
- Full-page flows that keep the rail visible: Impor dari Excel, Gaji steps.
When not to use
- Login, setup and invite pages → a centred 440 form page on bg-page, without the shell.
- A task on top of the page → Sheet or Dialog, never a second shell.
- Sub-navigation inside a page (Pengaturan sections) → a left list inside the content, not more rail items.
Which one?
Do and don't
Short labels, one active tileLabels fit in 76 px on one line ("Slip gaji"). Only the current section is coloured, so the user sees at once where they are.
Tinted tiles for every item, badges everywhereColoured tiles on inactive items hide the current page. A count on Gaji or Karyawan makes every number look urgent.
Installation
Add AppShell 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 { AppShell } from "@/components/mahr/app-shell"| Prop | Type | Default | Description |
|---|---|---|---|
role | "admin" | "hr" | "manager" | "employee" | – | Required. Picks the rail item set and the company pill mode. Screens never add or reorder items. |
activeItem | RailItemId | – | Colours that tile; also the default top-bar title. |
title | string | – | Top-bar title, the page's only h1 (28). Defaults to the active item's label. Pass the page name here ("Cuti saya"), never again in the content. |
company · user | { name, logoUrl? } · { name, avatarUrl? } | – | Pill label truncates at 260 px. No logo → initials. |
unreadCount | number | 0 | > 0 → red bell dot (no number). |
notifications | { items: ShellNotification[]; onOpen?; onMarkAllRead?; onSeeAll? } | – | Required. The bell popover (Notifikasi, 400 wide). |
account | { subtitle; onSelect? } | – | Required. The avatar menu (Menu akun, 260 wide). |
companies · leaveCount | ShellCompanies · number | – | admin and hr only (the type forbids them for manager and employee): the company switcher (required) and the Cuti count badge (> 0). |
openOverlay · onOpenOverlayChange | "notifications" | "company" | "account" | null | – | Controlled overlay (one open at a time). Leave out for uncontrolled. |
linkRender | ReactElement | – | Router link for rail items, e.g. <Link href="" />. Default <a href>. |
children | ReactNode | – | The page. May start with PageHeader (context + one page action, no title). |