Skip to content
esc

Sidebar

Navigationshadcn/ui

Desktop navigation column, 256px: a header with the product, sections of links with icons and counts, and a footer for the account. Simpler than shadcn's Sidebar system; no collapsing.

When to use

  • Put the 4 to 7 main sections first, settings and help in a later section.
  • Place it in a flex row with the page: <div className='flex h-screen'><Sidebar/>…</div>.
  • Don't use it on phones; use TabBar.
  • Don't nest more than one level; link to a page with its own tabs instead.

Accessibility

Role
navigation with a list of links
Keyboard
Tab moves between items. Enter opens.
Notes
Give the nav an aria-label such as 'Main'.
Note
Section titles are text, not headings, to keep the outline clean.

Props

  • SidebarSection title

    string

    Group name, e.g. 'Workspace'.

  • SidebarItem icon

    ReactNode

    A lucide icon.

  • SidebarItem active= false

    boolean

    Current page; sets aria-current='page'.

  • SidebarItem count

    number

    Number at the end, e.g. open tickets.

  • SidebarItem asChild= false

    boolean

    Pass your router link as the only child, label inside: <NextLink href='/'>Home</NextLink>.

Prompt for your agent

Use the UnbuiltUI Sidebar. Call unbuilt_get_component("Sidebar") first and follow its spec: variants, states, usage rules and accessibility.

unbuilt_get_component returns

0 variants4 states5 props4 usage rules4 a11y notes8 tokens1 example

Add it with shadcn

$npx shadcn add https://unbuiltui.com/r/sidebar.json

Tokens · 8

bg.surfacebg.subtleborder.subtlefg.defaultfg.mutedfg.subtleborder.focusradius.md