App shell
A React component in Beamline's Dashboard category.
The frame for every app screen: collapsible sidebar with grouped navigation, top bar and page.
Use it for
- The root layout of a SaaS app, dashboard or terminal, full screen or contained in a panel, split view or preview.
Not for
- Marketing pages.
- Custom sidebars → compose sidebar parts directly.
Anatomy
- root (data-room: full · rail · drawer)
- sidebar (brand, nav groups with badges, footer, rail)
- scrim (drawer room only)
- top bar (toggle, title, actions; no banner landmark when contained)
- main (the page main landmark in both modes; mainAs=div when an enclosing page owns main), inside a page area that is a size container
Variants
- collapsible: icon, offcanvas
- contained: viewport, parent box
- sidebarTone: default, brand, contrast
States
- expanded
- collapsed
- rail room (under 56rem): folded to icons, names in tooltips; a choice to expand lasts until the room changes step
- drawer room (under 35rem): the sidebar opens over the page from its edge on a scrim; the page is inert while it is open
- mobile sheet (<768px window)
Keyboard
- ⌘B / Ctrl+B toggles the sidebar (in the drawer room it opens and closes the drawer)
- Nav items are links or buttons; the active one has aria-current=page
- Drawer: opening moves focus to the current page's item; Escape, the scrim or a chosen page closes it and focus returns to the toggle
Motion
The sidebar's width eases on --pui-duration-standard whether a person folds it or the room does (full → rail → away); the drawer grows from the shell's edge the same way and its scrim fades with --pui-fade-in / --pui-fade-out. Reduced motion: the width changes at once, the scrim still fades.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
nav (required) | { label?, items: { label, icon?, href?, onSelect?, active?, badge? }[] }[] | — | Navigation groups shown in the app sidebar. Required. |
brand / footer / title / actions | ReactNode | — | brand: Top of the sidebar: product mark or workspace switcher. footer: Bottom of the sidebar: user menu, plan usage. title: Left side of the top bar, after the sidebar toggle: breadcrumb or page title. actions: Right side of the top bar: search, actions, notifications. |
collapsible | 'icon'|'offcanvas' | — | `icon` collapses to an icon rail, `offcanvas` slides away. ⌘B toggles either. |
open / defaultOpen / onOpenChange | boolean | — | open: Controlled open state; omit to use defaultOpen. defaultOpen: Whether the sidebar is open in a room wide enough for it (the person's choice; a narrower room folds it on its own and gives the choice back when the room grows). onOpenChange: Reports open state after a change; no callback by default. |
fold | boolean | true | Fold the sidebar by the shell's own width, not the window's: an icon rail under 56rem, a drawer over the page under 35rem. Default true; false keeps the sidebar as the person left it at any width. |
contained | boolean | — | Fill a parent box instead of the viewport (for embedding in a page, a preview or a split view). |
mainAs | "main" | "div" | — | The page area's landmark: `main` in both modes. Set `mainAs="div"` when an enclosing page already owns the main landmark. |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the page inset; no ref by default. |
classNames | AppShellClassNames | — | Classes for the named visual parts; no part overrides by default. |
sidebarTone | "default" | "brand" | "contrast" | "default" | Deprecated sidebar surface treatment; omitted by default. Deprecated: Use sidebarAppearance instead. |
sidebarAppearance | SidebarProps["appearance"] | — | Sidebar surface treatment; defaults to the look chrome. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
insetStyle | CSSProperties | — | Inline styles on the page inset; no inset overrides by default. |
rootRef | Ref<HTMLDivElement> | — | Receives the outer visual root; no ref by default. |
sidebarClassNames | Partial<Record<"root" | "header" | "footer" | "body" | "content" | "rail", string>> | — | Classes for the sidebar component's named parts; no overrides by default. |
brand | ReactNode | — | Top of the sidebar: product mark or workspace switcher. |
footer | ReactNode | — | Bottom of the sidebar: user menu, plan usage. |
title | ReactNode | — | Left side of the top bar, after the sidebar toggle: breadcrumb or page title. |
actions | ReactNode | — | Right side of the top bar: search, actions, notifications. |
children (required) | ReactNode | — | Content rendered inside the component. Required. |
defaultOpen | boolean | — | Whether the sidebar is open in a room wide enough for it (the person's choice; a narrower room folds it on its own and gives the choice back when the room grows). |
open | boolean | — | Controlled open state; omit to use defaultOpen. |
onOpenChange | ((open: boolean) => void) | — | Reports open state after a change; no callback by default. |
className | string | — | Classes on the documented visual root; no override by default. |
ref | Ref<HTMLDivElement> | — | Receives the page inset; no ref by default. |
Built from
- sidebar
Used in
- Analytics dashboard
- Contact profile
- CRM pipeline
- File manager
- Helpdesk inbox
- Invoices
- Orders admin
- Product analytics
- Project board
- Projects
- Report builder
- Sales dashboard
- Status dashboard
- Team calendar
- Workflow builder
Dependencies
@radix-ui/react-slot
Import
import { AppShell } from "@beamline/app-shell";
Get it
App shell is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in Dashboard
- Explainable total: A total that answers "why this much?" in place: it unfolds into the steps that made it — a waterfall whose bars start where the last step ended, each…
- Explainable change: A metric whose change explains itself: at rest the value, the change against a named period and a thin ribbon of its causes under the change; opened in…
- Budget vessels: Budgets as glasses of money: the liquid is what is left (free money on top, committed money as a lighter layer under it), the lip at the period's budget…
- Insight cards: Findings from an agent, one per page: the sentence, the series it is about with their change, a chart to scrub that names each point, and a follow-up…
- Tracker: A row of status blocks for uptime, job runs or daily checks, with tooltips and a legend.
- Metric card: A KPI that fills its tile: label, a value that rolls to each new number, the change with arrow, sign and tone, what it compares with and the value it…
- Category bar: One bar split into labelled ranges with an optional marker that names its range.
- Bar list: Ranked horizontal bars, label and value over a meter, one line per row when there is room — top pages, sources, customers.