MobileSidebar
Standalone mobile site navigation sheet for pages with or without a top navbar.
Quick Preview
Usage
Import the sidebar directly when a page needs mobile navigation without rendering
TopNavbar.
import { GiddaaLogo } from "@giddaa-housing/ui/logo";
import { MobileSidebar } from "@giddaa-housing/ui/mobile-sidebar";
import { HouseIcon } from "lucide-react";
<MobileSidebar.Root>
<MobileSidebar.Trigger aria-label="Open main navigation" />
<MobileSidebar.Content>
<MobileSidebar.Header>
<GiddaaLogo className="h-[38px] w-[90px] text-fg-brand" />
<MobileSidebar.Title>Main navigation</MobileSidebar.Title>
<MobileSidebar.Close aria-label="Close main navigation" />
</MobileSidebar.Header>
<MobileSidebar.Body>
<MobileSidebar.Nav aria-label="Main navigation">
<MobileSidebar.List>
<MobileSidebar.Item>
<MobileSidebar.Group>
<MobileSidebar.GroupTrigger icon={<HouseIcon />}>
Houses
</MobileSidebar.GroupTrigger>
<MobileSidebar.GroupPanel>
<MobileSidebar.SubList>
<li>
<MobileSidebar.SubLink href="/houses">
Browse all homes
</MobileSidebar.SubLink>
</li>
</MobileSidebar.SubList>
</MobileSidebar.GroupPanel>
</MobileSidebar.Group>
</MobileSidebar.Item>
<MobileSidebar.Item>
<MobileSidebar.Link href="/agents">Agents</MobileSidebar.Link>
</MobileSidebar.Item>
</MobileSidebar.List>
</MobileSidebar.Nav>
</MobileSidebar.Body>
</MobileSidebar.Content>
</MobileSidebar.Root>;Examples
Without TopNavbar
This example renders MobileSidebar directly, without TopNavbar. Its trigger
is visible at every viewport by default, so the consuming page owns where and
when it appears. Add a responsive utility class to the trigger when an
application only wants it visible at mobile widths.
Props
| Prop/API | Type | Default | Description |
|---|---|---|---|
MobileSidebar.Root | Sheet root props | - | Inherits the surrounding theme scope; wrap it in .light or .dark to pin one (see Theming). |
MobileSidebar.Trigger | Sheet trigger props | - | Opens the sidebar and provides a menu icon when no children are supplied. |
MobileSidebar.Content showCloseButton | boolean | false | Enables the Sheet floating close control; prefer MobileSidebar.Close in the header for the Figma layout. |
MobileSidebar.Content className | string | - | The panel is portalled to document.body; pass light or dark here when the page scopes its theme below <body>. |
MobileSidebar.Link icon | ReactNode | - | Places an icon in the fixed 20px leading column. |
MobileSidebar.Link active | boolean | false | Marks the current page and applies the active surface. |
MobileSidebar.Group | Base UI Collapsible root props | - | Owns controlled or uncontrolled expanded state for a group of sub-items. |
MobileSidebar.GroupTrigger icon | ReactNode | - | Non-navigating button that toggles its group panel. |
MobileSidebar.GroupTrigger active | boolean | false | Marks the group when one of its descendant destinations is current; independent of expanded state. |
MobileSidebar.GroupPanel | Base UI Collapsible panel props | - | Animated container for a group’s nested list. |
MobileSidebar.Subheading | li props | - | Labels a nested link group such as Mortgage Houses or Plans. |
Accessibility
- Give
MobileSidebar.TriggerandMobileSidebar.Closedescriptive labels. - Include
MobileSidebar.Titleeven when it remains visually hidden. - Use
MobileSidebar.Linkfor destinations andMobileSidebar.GroupTriggerfor expandable groups; group titles intentionally do not navigate. - Base UI synchronizes
aria-expanded, panel visibility, and keyboard activation for each group. - Mark only the current destination with
active. - The underlying Sheet traps focus and closes on Escape or outside press.