Sidebar

App navigation down the side of the screen, collapsible to an icon rail.
Stable
Web
iOS
Android
@advui/core
Source

App sidebar

DashboardCollapse the sidebar with the arrow button.
DashboardExpand the sidebar with the arrow button.

Installation

pnpm
pnpm add @advui/core
npm
npm install @advui/core

Usage

import { Sidebar } from '@advui/core'
import { HomeIcon } from '@advui/icons'

<Sidebar aria-label="App">
  <Sidebar.Header>
    <Sidebar.Toggle />
  </Sidebar.Header>
  <Sidebar.Content>
    <Sidebar.Group label="Workspace">
      <Sidebar.Item href="/" icon={<HomeIcon />} active>Dashboard</Sidebar.Item>
    </Sidebar.Group>
  </Sidebar.Content>
</Sidebar>

Examples

In a drawer on phones

API reference

Sidebar

PropTypeDefaultDescription
aria-labelstring'Sidebar'Names the navigation landmark.
collapsedboolean—Icon-only rail (64px instead of 256px).
defaultCollapsedboolean—Starting `collapsed` when uncontrolled.
onCollapsedChange(collapsed: boolean) => void—Called with the new `collapsed`.

Sidebar.Header

The top row: brand and toggle.

Sidebar.Content

The scrolling middle: groups and items.

Sidebar.Footer

The bottom, such as the account.

Sidebar.Group

PropTypeDefaultDescription
labelstring—Heading that names the list; hidden but still read when collapsed.

Sidebar.Item

PropTypeDefaultDescription
iconReactNode—Shown alone when collapsed.
hrefstring—Link target. On iOS and Android a path goes to the router registered with `setRouter`, and an absolute URL opens with the system.
onPress(event) => void—Called before the `href` is followed; `event.preventDefault()` stops it. Without an `href`, navigate here.
renderReactElement—Your router’s link element.
activebooleanfalseThe current page (`aria-current="page"`).
badgeReactNode—A count or tag after the label.
disabledbooleanfalseNot pressable.

Sidebar.Toggle

Collapse / expand button (`aria-expanded`, `aria-controls`).
PropTypeDefaultDescription
labels{ collapse: string; expand: string }—Button names, for translation.

useSidebar()

`{ collapsed, setCollapsed }` for your own header and footer content.

Accessibility

  • A nav landmark named by aria-label; each group is a list named by its label.
  • Items are links (<a> with href); the current page has aria-current="page" on web, and "current page" in its name on native.
  • Collapsed, the labels and badges are visually hidden but stay in each link’s name, so the icon rail is still fully labelled.
  • The toggle is a named button with aria-expanded. Rows are 44pt tall on touch screens.
  • Inside AppShell.Sidebar the area is the navigation landmark, so the Sidebar does not add its own.
Keyboard interactions
KeyAction
TabMoves through the links and the toggle.
EnterFollows the focused link.

Responsive behavior

Give it the full height of the layout. In an AppShell, put it in AppShell.Sidebar: below the breakpoint it moves into the shell’s drawer, where it fills the width, does not collapse, and closes the drawer when an item is pressed. Elsewhere, hide it on phones (display="max-md:none") and put the same items in a Drawer.

Platform notes

Web
Sidebar.Content scrolls when the items overflow.
iOS
Wrap long content in a ScrollArea to scroll it. A path in href goes to the router registered with setRouter (since 0.15.0; before, items navigated only in onPress).
Android
Same as iOS, with the ripple when the config has androidRipple.
Since v0.6.0Last updated Nov 2, 2026Edit this page on GitHub