Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

Sidebar

  • Stable
  • WCAG 2.2 evidence
  • RTL

Persistent app navigation: a named nav landmark that is 264 px wide (w-sidebar) or a 72 px icon rail (w-sidebar-collapsed), with a header (workspace switcher and collapse toggle), the main items, a footer and the user card. Built for wide and medium layouts; on narrow viewports render a NavigationBar instead (the brief's viewport pattern: expanded from xl, the rail from md, Navigation bar below md). Accessibility: one nav landmark with a name (WCAG 1.3.1, 2.4.1); the optional skip link bypasses it (2.4.1); Tab moves through the items in visual order (2.4.3); the collapse toggle exposes aria-expanded and keeps focus (4.1.2); in the rail every item keeps its name and shows it in a tooltip; the main area scrolls inside the sidebar with scroll padding so focus is not hidden (2.4.11). Consumer duties: a unique landmark name when the page has several navs; render only one of Sidebar and NavigationBar at a time (hide the other with display: none, which also hides its landmark); the responsive switch between expanded and rail (control isCollapsed from a media query) and the page skip-link target.

import { Sidebar } from "@nexera-ui/react";
Loading example…
9
examples
14
props
4
live controls
1
platform
10
WCAG criteria
1
block uses it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
variant
isCollapsed
defaultCollapsed
isCollapsible
Generated code
import { Sidebar } from "@nexera-ui/react";

<Sidebar />

Examples 8

The same examples as Storybook, rendered live. Open Code to copy one.

Collapsed

Figma Collapsed=True: the 72 px rail. Names stay available to assistive technology and show in tooltips.

Loading example…

Light

Figma Variant=Light: bg/surface with the nav/* tokens, which follow the theme.

Loading example…

Light collapsed

Figma Variant=Light, Collapsed=True.

Loading example…

Search and copilot recipe

Recipe for the Figma Search and Copilot card frames (sidebar content, not components): a search button as the first item, and a card in the footer render function that the rail hides.

Loading example…

Responsive pattern

The brief's viewport pattern, as the consumer wires it: expanded from xl (1280 px), the rail below. Below md (768 px) render a Navigation bar instead and hide the sidebar with display: none so only one landmark exists.

Loading example…

Long labels

Long labels wrap when expanded.

Loading example…

Right to left

Right to left: the sidebar sits on the right, the border and indicator flip, tooltips open to the left.

Loading example…

Props 14

Press "Try it" on a card to load that prop into the playground.

14 props shown

variantNexera
"brand" | "light"

Colour scheme: brand (dark sidebar/* tokens, the same in light and dark themes) or light (bg/surface with the nav/* tokens, which follow the theme). Parts inside take it from the sidebar.

Default brand
isCollapsedNexera
boolean

Whether the sidebar shows the 72 px icon rail, controlled. Use with onCollapsedChange.

Default –
defaultCollapsedNexera
boolean

Whether the sidebar starts as the rail (uncontrolled).

Default false
onCollapsedChangeNexera
(isCollapsed: boolean) => void

Called when the toggle (or a group item pressed in the rail) collapses or expands the sidebar.

Default –
headerNexera
ReactNode

Figma Header content before the collapse toggle, usually a WorkspaceSwitcher.

Default –
childrenNexera
SidebarSlot

Main navigation: SidebarItem, SidebarSection, search. It scrolls on its own when it does not fit. A function receives { isCollapsed }.

Default –
footerNexera
SidebarSlot

Content pinned to the bottom above the divider. A function receives { isCollapsed }, for content such as the Copilot card that the rail hides.

Default –
userCardNexera
ReactNode

Figma Sidebar user card slot under the divider: a SidebarUserCard. The divider is drawn when it is set.

Default –
isCollapsibleNexera
boolean

Show the collapse toggle in the header. It carries aria-expanded and controls the sidebar.

Default true
toggleLabelNexera
string

Accessible name of the collapse toggle. It stays the same while aria-expanded announces the state. Translate it.

Default Sidebar
skipLinkHrefNexera
string

Target of an optional skip link rendered as the first focusable element, for example "#main" (WCAG 2.4.1). The link is visually hidden until focused. Give the target tabIndex={-1} so focus lands on it.

Default –
skipLinkLabelNexera
string

Text of the skip link. Translate it.

Default Skip to main content
aria-labelNexera
string

Name of the navigation landmark. Every landmark on a page needs a unique name; use aria-labelledby to point at a visible heading instead. Translate it.

Default "Main"
aria-labelledbyNexera
string

Id of a visible element that names the landmark; replaces aria-label.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

6 direct · 4 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · supporting test
  • 1.4.10ReflowLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.3.3Animation from InteractionsLevel AAA · supporting test
  • 2.4.1Bypass BlocksLevel A · tested directly
  • 2.4.3Focus OrderLevel A · tested directly
  • 2.4.4Link Purpose (In Context)Level A · tested directly
  • 2.4.11Focus Not Obscured (Minimum)Level AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

  • data-hovered
  • data-pressed
Usage
<Sidebar className="data-hovered:opacity-90 shadow-sm" />

Used in blocks

Related components