A slide-out drawer for mobile navigation. MobileNav is the mobile counterpart to SideNav and accepts the same children. Use it on narrow viewports where a persistent sidebar is not practical. Inside AppShell, use MobileNavToggle as the trigger; it reads state from context automatically.
A slide-out drawer for mobile navigation. MobileNav is the mobile counterpart to SideNav and accepts the same children. Use it on narrow viewports where a persistent sidebar is not practical. Inside AppShell, use MobileNavToggle as the trigger; it reads state from context automatically.
Share the same nav items between MobileNav and SideNav by extracting them into a variable.
Provide a header when the drawer's purpose is not obvious from its content.
Inside AppShell, use MobileNavToggle to open the drawer; it reads state from context. Do not pass isOpen/onOpenChange to the toggle.
Whether the drawer is open. Inside AppShell, this is managed automatically via context. Outside AppShell, provide this prop to control the drawer yourself.
onOpenChange
(isOpen: boolean) => void
Called when the drawer visibility changes (backdrop click, Escape key, or close button). Inside AppShell, this is managed automatically via context.
Header content for the drawer. Rendered next to the close button. Pass a string for a simple text heading, or a ReactNode for custom content (logo, search bar, etc.).
width
number · default 320
Drawer width in pixels. Capped at 85vw to prevent overflow on small screens.
side
'start' | 'end' | 'auto' · default 'auto'
Which side the drawer slides from. Start is left in LTR, right in RTL. Auto picks a side based on the trigger position.
MobileNavToggle
Prop
Type and behavior
children
ReactNode
Custom content to render instead of the default hamburger icon.
label
string · default 'Open navigation'
Accessible label for the toggle button.
Anatomy
Navigation overlay · required
Full-viewport dialog overlay that hosts the mobile navigation drawer.
Drawer · required
Painted panel that slides in from the resolved viewport edge.
Header · required
Fixed row containing optional header content and the close button.
Content · required
Scrollable region containing the navigation content.