Components · Layout
App Shell
StableAdded v0.0.1
Full-height application frame: a header row over a body with a sidebar slot and a scrolling main region.
import { AppShell } from '@nexub/react';Usage
Use it for
The outer frame of a product or dashboard: header, side navigation, content
Use something else for
Marketing or content pages: use `Section` and `Container`
A single panel inside a page: use `Grid` or `Flex`
Examples
Header, sidebar and main
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| AppShell.Root | compound | — | Viewport-height grid (h-screen): header row, then the body. Override the height with className when it is not the whole page. |
| AppShell.Header | compound | — | First row, e.g. a TopNav.Root. |
| AppShell.Body | compound | — | Second row: lays out the sidebar and main side by side. |
| AppShell.Sidebar | compound | — | Fixed-width column that scrolls on its own, e.g. a Sidebar.Root. |
| AppShell.Main | compound | — | The <main> landmark: takes the remaining width, scrolls on its own, padded by default. |
| ...props | React.HTMLAttributes<HTMLDivElement> | — | Every part forwards its ref and HTML attributes. |
| onOpenChange | ((open: boolean) => void) | — | |
| open | boolean | — | 10.6: the mobile navigation drawer (see AppShell.Sidebar's drawerBelow), controlled. |
On iOS & Android
Web only
App Shell has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.