AppShell
Loading example…
Root of the app frame (sidebar + topbar + page). It is the app container: the sidebar turns
into a drawer and the topbar shows its menu button when the SHELL is under 900 px wide,
whatever the viewport is, so the same shell works in a full page, a preview or a story.
The context value is a store that never changes identity, and it reads false on the server
and on the first client render. Only components that call useAppShell update, and only once
the measure arrives, so nothing above a still-dehydrated Suspense boundary re-renders during
hydration (a provider value that changed there made Next.js client-render those boundaries).
Import
Section titled “Import”import { AppShell } from "@jcsoftdev/ui/shell";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/shell/app-shell.
export const Default: Story = { parameters: { a11y: { test: "todo" } }, render: (args) => ( <Frame> <ShellDemo className={args.className} /> </Frame> ),};Source of the Storybook story.
| Prop | Type | Default | Description |
|---|---|---|---|
children * |
ReactNode |
||
bottomBar |
ReactNode |
Phone navigation, usually a BottomNav. Rendered after the children and fixed to the bottom edge; while the shell is compact it reserves the bar’s height and safe-area inset at the bottom and publishes it as the --app-bottom-bar CSS variable (on the shell … |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/shell/app-shell/app-shell.tsx