Genesis
@stable

AppShell

packages/ui/src/components/layout/AppShell.tsx

Import
Subpath export: @marktiderman/genesis-ui/layout
import { AppShell } from "@marktiderman/genesis-ui/layout";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

AppShell

PropTypeDefaultDescription
appName*string—App name shown in sidebar header
children*ReactNode—Page content
activePathstring—Current location used to highlight the active nav item. Pass the full location, `pathname + search + hash` (React Router: `useLocation()`), so items whose `to` names a query or hash (`/admin?tab=users`) can become active. A pathname alone still works for path-only items, `end` included. Omit to disable active highlighting.
appLogostring—App logo letter or short text (ignored when `logo` is set)
collapsedboolean—Controlled collapse (desktop rail). Overrides the stored user choice and every default.
collapsedHeaderSlotReactNode—Compact slot shown in the **collapsed** desktop rail, where `headerSlot` is hidden for space. Use it to keep a core affordance reachable without expanding — e.g. an icon-only product switcher. Omit to hide the header region entirely while collapsed.
defaultCollapsedboolean—This page's default: open the desktop sidebar collapsed (`true`) or expanded (`false`) until the user toggles it. Reactive, so a layout can pass it per route. Wins over `navigation`'s `defaultCollapsed` and `options.defaultCollapsed`; the user's own choice (persisted under `optionsStorageKey`) wins over all of them. @stability Beta
dockReactNode—Docked panels that stay open across pages, bottom-right: genesis-chat's `ChatDock`. Fixed outside the scrolling page, above it, and lifted clear of the phone's bottom bar. The region lets clicks through; the dock's own windows take them. @stability Beta
footerReactNode—Footer region above the user slot (version, links)
headerItemsNavItem[]—Links for the top bar (a "top" menu location: Help, a booking page, a site). Drawn at the end of the top-tabs bar, in a thin row above the page on other wide layouts, and in the phone's drawer. @stability Beta
headerSlotReactNode—Slot below the logo row (product switcher, workspace picker, …)
isActive((to: string, activePath?: string) => boolean)—Optional custom active-state matcher. Defaults to a prefix match (with `/` treated as exact), mirroring React Router `NavLink`. The sub-navigation levels above the page read it on navigation: a new matcher alone, with no `activePath` change, applies from the next navigation.
linkComponentLinkComponent({ href, children, testID, ...rest }) => ( <a href={href} data-testid={testID} {...rest}> {children} </a> )Injectable link component. Defaults to a plain `<a>` (no router). Pass a router adapter — e.g. React Router `({ href, ...p }) => <Link to={href} {...p} />` or Next.js `next/link` — to get client-side navigation.
logoReactNode—Custom logo node — preferred over `appLogo` letter tile
mobileHeaderSlotReactNode—Replaces the app name in the phone's top bar: a workspace switcher (`WorkspaceSwitcher variant="bar"`), so the viewer always sees where they are working. @stability Beta
mobileNavItemsNavItem[]—Items for the mobile bottom tab bar. Defaults to top-level `navItems` (no children). Pass a short list for apps with large sidebars; pass `[]` and set `options.showMobileBottomNav: false` to hide.
navigationNavigationNode<NavItem>—The app's logical navigation hierarchy. AppShell resolves it against `activePath` (see `resolveNavigation`) and derives: - the sidebar's global items from the root's `items` (unless `navItems`), - a contextual section from the current node's `items`, labelled with the node's `label` (`$param` segments in `to` filled from the URL), - the mobile tab bar: the contextual items when there are any, else the global top-level items (unless `mobileNavItems`), - a back link to the current node's logical parent (unless `parentNavigation`). @stability Beta
navItemsNavItem[]—Primary navigation items. Optional when `navigation` is set: the tree root's `items` are the global nav then.
onCollapsedChange((collapsed: boolean) => void)—Called with the new state whenever the user toggles the sidebar.
optionsAppShellOptions—Chrome config (developer defaults + optional in-sidebar menu)
optionsStorageKeystring—Persist user sidebar-option overrides + collapse state (localStorage)
parentNavigationParentNavigation | null—Back-to-parent link rendered in the content header, above `children`, on mobile and desktop. Derived from `navigation` when omitted; `null` hides it. Use this instead of placing a back row inside page content. @stability Beta
secondaryNavItemsNavItem[]—Secondary nav (e.g. “More”) — rendered below a divider when shown
secondaryNavLabelstringMoreLabel above secondary nav (default “More”)
showThemeToggleboolean—@deprecated Prefer `options.showThemeToggle`. Kept for sample-app back-compat; merges into resolved options when `options` omits it.
subNavenum—This page's sub-navigation mode (see `AppShellOptions.subNav`). Wins over `navigation`'s `subNav` and `options.subNav`; the page's own `useAppShellSubNav(items, { mode })` wins over it. @stability Beta
subNavLabelstring—Accessible name of the sub-navigation tab row. Defaults to the current navigation node's label, else "Page sections".
userSlotReactNode—User / account block at the bottom of the sidebar. When the rail is collapsed, AppShell hides any descendant carrying the `data-shell-user-detail` attribute (e.g. name/email text) so only a compact element (avatar, initial) remains — tag the detail wrapper you want hidden in the collapsed rail with that attribute.
Storybook
Storybook hosts the canonical visual reference with controls for every variant.