App Shell
A responsive application frame for top navigation, side navigation, and main content.
AppShell assembles the outer product frame while leaving navigation and page content composition to Header and SideNav. Its outer canvas uses --background-default, separating the SideNav and content surfaces that use --sidebar (#eceff1 in light mode and #0f0f0f in dark mode). The document remains the scrolling container, so the side navigation can stay sticky without trapping content in a nested scroller.
Import
Section titled “Import”import { AppShell, Header, SideNav } from "@zentara-co/zenos-ui";Anatomy
Section titled “Anatomy”AppShell├── banner├── sideNav├── topNav└── main contentPass complete navigation components into the named regions. AppShell owns the main landmark, responsive compact-navigation state, skip link, and overall surface hierarchy.
Responsive navigation
Section titled “Responsive navigation”On desktop and tablet landscape, sideNav stays at inline start and controls its own collapsed state. On mobile and tablet portrait, AppShell keeps a collapsed rail in the layout. Activating SideNav.Toggle opens the same navigation in an inline-start sheet—left in LTR and right in RTL. Selecting a navigation item closes that sheet.
Use sideNavOpen, defaultSideNavOpen, and onSideNavOpenChange when application state must observe or control the compact sheet. Use SideNav’s collapsed API only when SideNav is outside AppShell.
Height and scrolling
Section titled “Height and scrolling”height="fill" gives the shell a minimum viewport height. height="auto" follows its content, which is useful when the shell is embedded in another surface. In both modes, the document owns vertical scrolling and the navigation remains sticky.
Content spacing
Section titled “Content spacing”contentPadding accepts the shared responsive spacing scale:
<AppShell contentPadding={{ base: "4", lg: "8" }}> <Dashboard /></AppShell>Variants
height: fillheight: auto AppShell Header SideNav
API
| Prop | Type | Default | Description |
|---|---|---|---|
banner / topNav / sideNav | ReactNode | — | Named shell regions. |
sideNavOpen | boolean | — | Controlled compact navigation sheet state. |
defaultSideNavOpen | boolean | false | Initial compact navigation state. |
onSideNavOpenChange | (open: boolean) => void | — | Runs when compact navigation changes. |
sideNavLabel | string | Navigation | Accessible name for the compact navigation sheet. |
contentPadding | Responsive<Spacing> | 0 | Main-region padding. |
height | fill | auto | fill | Viewport or content-based shell height. |
skipLinkLabel | string | Skip to content | Accessible text for the keyboard skip link. |
native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”AppShell renders a main landmark and a keyboard-accessible skip link. Give the side navigation a meaningful aria-label; sideNavLabel names the compact navigation dialog and its trigger. Keep only one top-level AppShell per application view.