Sidebar
An app's navigation beside its page, which collapses to its icons or out of sight, and is a sheet on a phone.
npx shadcn add https://kinoui.com/r/sidebar.jsonCopy install command
Examples
Default
Collapse it with the button in the page’s header, or ⌘B and Ctrl+B: it narrows to its icons, and each icon’s tooltip names its page.
Offcanvas
With collapsible='offcanvas', it slides out of sight. Rest the pointer on the screen’s edge and it comes back over the page until the pointer leaves.
Side
Set side to end to dock it at the other edge. Start and end follow the text direction.
Installation
Copy code
npx shadcn@latest add https://kinoui.com/r/sidebar.json- Files
lib/reduce-motion.tslib/scroll.tslib/refs.tslib/resize.tslib/swap.tsxlib/popup.tslib/glide.tsxcomponents/kino/tooltip.tsxlib/cut.tsxcomponents/kino/badge.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/collapsible.tsxlib/keys.tsxcomponents/kino/kbd.tsxcomponents/kino/scroll-area.tsxlib/panel.tsxcomponents/kino/sheet.tsxlib/controllable.tslib/run-progress.tslib/highlight.tscomponents/kino/sidebar.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
SidebarProvider
Sidebar
SidebarMenuButton
SidebarMenuSection
Data attributes
CSS variables
Accessibility
- The sidebar is a
navlandmark named byaria-label, andSidebarInsetis the page’smainlandmark. Rows are links or buttons in the tab order; the current page isaria-current="page". - The trigger is a button with
aria-expandedandaria-controls, andaria-keyshortcutsnames the shortcut. Its label says what it does: Collapse sidebar, Expand sidebar or, on a phone, Open sidebar. - A section follows the disclosure pattern: its row is a button with
aria-expanded. In the rail it reads as closed, and focus inside a part that hides moves to the row that stays. - In the rail, every row is named by its tooltip, which opens on hover after 200ms and with keyboard focus. A label cut short shows whole in its tooltip.
- An offcanvas sidebar that peeks never takes focus. While it shows, Escape sends it away and puts focus back on the trigger; a menu open inside, or focus moved in by the keyboard, keeps it.
- On a phone it is a modal sheet: focus moves in, Escape closes it, and following a link closes it too.
- The current page takes the system’s highlight colours under forced colours, and the focus ring keeps an outline there.
- When the system asks for less motion, it collapses, opens and peeks at once, and labels only fade.