Ravox KitNavigation

Sidebar

The navigation of an admin dashboard, in parts: groups, items with an icon and count, header and footer. Collapses to icons only (with a tooltip), remembers the choice, toggles with Ctrl/⌘ + B and becomes a drawer on narrow screens.

Visão geral

Vendas hoje

R$ 4.318,20

Pedidos abertos

12

  • #4821Marina DuarteR$ 312,40Pago
  • #4820Caio MenezesR$ 89,90Separando
  • #4819Ana Paula ReisR$ 1.204,00Enviado
  • #4818Jorge LimaR$ 45,00Pago

Settings

Toggles

Examples

Installation

The command creates components/ui/sidebar.tsx in your project and installs the theme with it. The file is yours: edit it as you like.

npx @ravox-ui/cli add sidebar

Props

PropTypeDefaultDescription
defaultCollapsedbooleanfalseCollapsed at the start; the remembered value wins (SidebarProvider).
collapsed / onCollapsedChangeboolean / (collapsed: boolean) => void—Controlled mode, e.g. a value read from a cookie on the server, with no jump on first paint (SidebarProvider).
storageKeystring | null"ravox-sidebar"localStorage key that remembers the state; null turns it off (SidebarProvider).
shortcutstring | null"b"Key that, with Ctrl or ⌘, collapses and opens; null turns it off (SidebarProvider).
labelstring"Sidebar"Name of the <aside> and the drawer (Sidebar).
label / collapsible / defaultOpenReactNode / boolean / boolean—Group title; collapsible turns it into a button that opens and closes (SidebarGroup).
icon / count / activeReactNode / number / boolean—Icon, number on the right (becomes a dot when collapsed) and aria-current="page" (SidebarItem).
href / asChild / onClickstring / boolean / MouseEventHandler—A link, Next's <Link> as the child, or a button without href (SidebarItem).
useSidebar(){ collapsed, toggle, drawerOpen, … }—The state of the bar for your own components (e.g. hide the brand name when collapsed).
SidebarTriggerComponentProps<"button">—Collapses and opens on wide screens; opens the drawer on narrow ones. Put it in the page header.

More in Navigation