AppShell

Rail + top bar + page background.

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

Employee

Rail 88: inactive items are grey stroke icons with no tile; the active item is a 44 tile (radius 14) in the module colour with a white solid icon. Top bar 72: page title 28, bell with a dot, company pill without chevron (read only), avatar 44.

Cuti saya

PT Mencari Cinta

Saldo tahun 2026 · semua cuti disetujui oleh HR

content slot · padding 8 24 40 · gap 16 · width 100%

Admin

Count badge only on Cuti (requests waiting for HR). Pengaturan and Bantuan use the ink tile. The company pill has a chevron (switch company). Narrow the window below 1024 px to see the menu button.

Pengaturan

content slot

Cuti count (motion)

HR role. Add a leave request to see the badge come in; approve the last one to see it go out.

Ringkasan

content slot

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?

role        top items (order)                                           bottom                  company pilladmin       Ringkasan · Karyawan · Organisasi · Cuti (count) · Gaji · Akses  Pengaturan · Bantuan    chevron (switch)hr          Ringkasan · Karyawan · Organisasi · Cuti (count) · Gaji          Bantuan                 chevron (switch)manager     Beranda · Cuti · Slip gaji · Profil · Organisasi                 Bantuan                 read onlyemployee    Beranda · Cuti · Slip gaji · Profil · Organisasi                 Bantuan                 read only

Do and don't

DoShort 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.
Don'tTinted 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.

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

API

import { AppShell } from "@/components/mahr/app-shell"
PropTypeDefaultDescription
role"admin" | "hr" | "manager" | "employee"–Required. Picks the rail item set and the company pill mode. Screens never add or reorder items.
activeItemRailItemId–Colours that tile; also the default top-bar title.
titlestring–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.
unreadCountnumber0> 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 · leaveCountShellCompanies · 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.
linkRenderReactElement–Router link for rail items, e.g. <Link href="" />. Default <a href>.
childrenReactNode–The page. May start with PageHeader (context + one page action, no title).