The standard application layout: Nav Header on top, side navigation at the inline-start edge and the page content on the canvas background.
Loading demo: app-shell-default
npx sdaia-ui@latest add app-shell
import { AppShell } from '@/components/ui/AppShell';
import { NavHeaderMenuItem } from '@/components/ui/NavHeaderMenuItem';
import { NavLogoPlaceholder } from '@/components/ui/NavLogoPlaceholder';1<AppShell2header={(layout) => ({3logo: <NavLogoPlaceholder size="medium" text="SDAIA" />,4items: [<NavHeaderMenuItem key="home" label="Home" mobile={layout === "compact"} />],5})}6sideNavigation={{ groups, footerProps: { mainText: "User name" } }}7navigation="expanded"8>9{/* page content */}10</AppShell>
`navigation="collapsed"` shows the 64 px icon rail. The toggle in the side navigation header switches between expanded (255 px) and collapsed; pair `navigation` with `onNavigationChange`, or use `defaultNavigation`.
Loading demo: app-shell-collapsed
Omit `sideNavigation` for pages that do not need it, such as the error pages. The content region keeps the canvas background and padding.
Loading demo: app-shell-header-only
With `dir="rtl"` the side navigation moves to the right, the header mirrors and every icon that has a direction flips.
Loading demo: app-shell-rtl
<header> holds the Nav Header <nav>, the side navigation is its own labelled <nav>, and the page content is the <main> landmark.labels.skipToContent).aria-expanded. The current item carries aria-current="page" in both the side navigation and its copy in the header menu.aria-expanded, Escape closes the menu and returns focus to the button, and choosing a side navigation item closes it too.labels.navigation and side navigation labels.navigation) so screen-reader users can tell them apart.Prop | Type | Default | Required |
|---|---|---|---|
header | AppShellHeaderProps | (layout: "desktop" | "compact") => AppShellHeaderProps | — | optional |
sideNavigation | AppShellSideNavigationProps | — | optional |
navigation | "expanded" | "collapsed" | — | optional |
defaultNavigation | "expanded" | "collapsed" | "expanded" | optional |
onNavigationChange | (navigation) => void | — | optional |
menuOpen | boolean | — | optional |
onMenuOpenChange | (open: boolean) => void | — | optional |
contentClassName | string | — | optional |
labels | Partial<AppShellLabels> | { skipToContent: "Skip to main content" } | optional |
dir | "ltr" | "rtl" | — | optional |
children | ReactNode | — | optional |