App shell
The frame of every admin screen: rail, top bar, bell, company switch, account menu.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/app-shell.jsonWhen to use
- Once, in the signed-in layout. Every admin and HR screen renders inside it; screens only fill the content slot.
- The role decides the rail items (admin: Ringkasan · Karyawan · Organisasi · Cuti · Gaji · Akses + Pengaturan · Bantuan).
When not to use
- Sign-in and invite pages → no shell, the page gradient only.
- A screen that needs its own frame (a full-screen import wizard) → still inside the shell; never a second rail.
Built from
Usage
The screen is the page content only. Put it inside AppShell (once, in your layout) and pass your data.
Installation
Adds the screen, its parts and its types. The components it uses come with it (registry dependencies).
API
import { AppShell } from "@/components/mahr/app-shell"| Prop | Type | Default | Description |
|---|---|---|---|
role · activeItem | "admin" | "hr" | "manager" | "employee" · RailItemId | – | The role sets the rail items; screens never add or reorder items. |
company · user | { name; logoUrl? } · { name; avatarUrl? } | – | Top-bar pill and avatar. |
unreadCount · leaveCount | number · number | – | Red dot on the bell · count badge on Cuti (admin, hr). |
notifications | { items: ShellNotification[]; onOpen?; onMarkAllRead?; onSeeAll? } | – | Bell popover, 400 wide. Unread = 600 title + primary dot. |
companies | { items: ShellCompany[]; currentId; onSwitch?; onAdd? } | – | Company switcher menu, 320 wide. Admin and hr only; the current company says "Sedang dipakai". |
account | { subtitle; onSelect?("profil" | "kata-sandi" | "bantuan" | "keluar") } | – | Account menu, 260 wide; Keluar in danger text. |
openOverlay · onOpenOverlayChange | "notifications" | "company" | "account" | null | – | Optional control; one overlay at a time. |
linkRender · logo | ReactElement · ReactNode | – | Router link for the rail; the 40 px logo. |