Sidebar

    Sidebar

    Basic composition

    ProviderRoot (panel) + Inset (main area). Rail is a narrow clickable strip on the inner edge of the panel (desktop) — it appears in the collapsed state and expands the panel; the example uses defaultCollapsed so the Rail is visible. Icons in MenuIcon: a uniform h-8 w-8 wrapper + SVG h-5 w-5. In the header Sidebar.HeaderTitle hides "Application" when collapsed (md:sr-only); Sidebar.Header centers the row when collapsed (md:justify-center).

    Main content
    Clicking Rail at the right edge of the collapsed panel or the trigger expands the navigation.

    Default collapsed state

    The defaultCollapsed prop on Provider — useful for narrow panels with icons; labels in GroupLabel are hidden on desktop in collapsed mode ( sr-only).

    Main content
    In collapsed mode the icons stay visible; the item and group labels are for screen readers (`sr-only`), and after expanding they appear next to the icons.

    MenuIcon + MenuLabel + MenuAction

    Sidebar.MenuIcon / Sidebar.MenuLabel — see above. Inline dropdown menu: DropdownMenu.Root + DropdownMenu.Trigger variant="icon" (dots). Sidebar.Trigger in Inset toggles the collapsed panel on desktop — a "collapse sidebar" icon (arrow into the panel). In DropdownMenu.Item you can insert an icon + text (text-label on the SVG).

    Main content
    Both rows have the same DropdownMenu on the item; in the header a Sidebar.Trigger with an icon to toggle the panel width (desktop).

    Collapsed panel: icons or abbreviation

    Without Sidebar.MenuIcon add the abbrevSource prop to Sidebar.MenuLabel, or use Sidebar.MenuButton with itemLabel (abbreviation in a rounded-md avatar).

    Expand with the trigger — abbreviations vs. full names
    In collapsed state: a custom icon, an abbreviation from `abbrevSource`, or one generated from `itemLabel`.

    Metadata

    Source: meta.generated.json (see npm run generate)

    File base/sidebar/meta.generated.json not found or path not allowed.