Integrated ResearchPicasso
Components

Sidebar

The app's primary navigation rail — where you are, and what else there is.

{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}

The app's primary navigation rail — where you are, and what else there is.

Import

import { SidebarProvider, Sidebar, SidebarHeader, SidebarBrand, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarGroupAction, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarMenuLabel, SidebarMenuBadge, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton, SidebarTrigger, SidebarInset } from "@ir/ui";

Watch out

  • On SidebarMenuSubItem, Hover and Active are the same fill — bg/sidebar-hovered — so a selected sub-item is indistinguishable from one the pointer happens to be over. The parent button does not have this problem: its Active is bg/primary/subtle. Built as drawn, and raised.

Variants

AxisOptionsDefault
inkon-dark · on-light—
activetrue · false—

Props

SidebarProvider

PropTypeRequiredWhat it does
mobileOpenbooleanThe phone nav drawer's open state (Sidebar mobile="drawer").
PropTypeRequiredWhat it does
mobile"drawer" | "fullscreen"Figma: Sidebar / Phone nav 40000659:33057. "drawer": below md the rail is not drawn inline — SidebarTrigger opens the same tree over the page instead, as a panel from the inline start with a strip of scrim left at the end. 44-tall items, a close on the brand, and picking an item closes it. From md up nothing changes. Opt-in for now; see guidance phone-nav. "fullscreen" is the old name for the same thing, from when the panel covered the whole screen. It still works.
mobileLabelstringAccessible name of the phone nav dialog.

SidebarHeader

PropTypeRequiredWhat it does
closeLabelstringThe name of the close shown in the phone nav. "Close", not "Collapse": SidebarTrigger collapses the rail to 48 and this dismisses an overlay, so two buttons called the same thing would do two different things.

SidebarBrand

PropTypeRequiredWhat it does
imagestringThe brand artwork. Covers the block; decorative, so it carries no name.
subtitleReact.ReactNodeA second line under the wordmark — Clarion's "powered by Iris".
markReact.ReactNodeShown instead of the wordmark when the rail is collapsed to 48.

SidebarMenuButton

PropTypeRequiredWhat it does
activebooleanMarks the current page. Sets aria-current as well as the treatment.

Do and don't

Keep the weight change and aria-current that come with active.

Don't — Mark the current page with the background alone.

Hover, focus and selection all tint the row. The weight is what still says which page you are on when the pointer is somewhere else.

Default to labels; let people collapse it.

Don't — Ship the collapsed rail as the default state.

An icon-only rail is a memory test. It is a fine option for someone who already knows the product, and a poor starting point for someone who does not.

Keep to one level, and use a page for anything deeper.

Don't — Nest submenus inside submenus.

The rail is narrow. Two levels of indent leave no room for the words, and the tree becomes something to navigate rather than navigation.

Group them and label the groups.

Don't — Put twelve items in one flat list.

The labels are what make a long rail scannable — and they are the first thing that disappears when it collapses, which tells you how much work they were doing.

Keep it to counts of things waiting.

Don't — Use the badge slot for status words.

A number in a nav row reads as "this many need you". A word reads as part of the label and makes the row ambiguous.

Use <SidebarHeader variant="brand">.

Don't — Cancel the header's padding with a class so the brand block can bleed.

no-restyle refuses the class, and it should — padding is the header's own decision. The brand bleeds to three edges in both products, so the header offers that shape itself rather than being argued out of its own.

Ship it with no image — the brand paints the rail's own surface.

Don't — Hold a new brand back until someone draws its artwork.

A brand with no asset reads as a quiet header, which is honest. An empty coloured box nobody designed is worse than no artwork at all.

Supply the asset as drawn, and pass ink="on-light" when it is pale.

Don't — Darken the artwork yourself, or restyle the block, to get the wordmark to read.

On a token surface fg/on/* is solved by measurement; a bitmap has no value to solve against. So the block lays a scrim under the text and the artwork no longer decides whether the wordmark reads. The one thing the file still settles is polarity — light artwork takes dark ink and a pale scrim.

Let size and weight carry the hierarchy.

Don't — Dim the second line with opacity.

There is no on-primary ink below emphasis to reach for, and opacity on text produces a contrast ratio nobody has measured. body/xs under heading/sm separates them without inventing a colour.

Below md, set mobile="drawer": the trigger opens the nav over the page as a panel from the inline start, with a strip of scrim left at the end edge to leave by. The header carries a 44 close, items are 44 tall, and picking one closes the nav.

Don't — Show the rail inline on a phone, or squeeze the page beside a 256 rail.

On the Clarion prototype the inline rail left a 390 phone with about 140 for the page. The icon-only rail is no answer either — below md it is the memory test this guidance already rules out.

Don't — Keep Help, theme and other global actions in a 48 top bar on a phone.

Every icon in the bar costs the breadcrumb width; with three of them the workspace name truncated to a few letters. The nav is one tap away and has room.

Accessibility

  • The active item sets aria-current="page" as well as the treatment, so "current" survives when colour does not.
  • The collapse toggle carries aria-expanded and an aria-label that changes with state — "Expand sidebar" or "Collapse sidebar" — because the icon alone never says which way it goes.
  • The PanelLeft glyph is aria-hidden; the button's label is its name.
  • Collapsing changes the rail's width at once, with no transition. Width is a layout property — animating it would re-lay out the page beside the rail on every frame — and Picasso moves transform and opacity only.
  • The brand header's image is decorative — empty alt and aria-hidden. The wordmark is the accessible text, so a brand header whose wordmark is itself artwork needs real text beside it or a label.
  • A scrim sits between the artwork and the text, so the wordmark's contrast comes from the component rather than from whatever the brand's file happens to contain. Removing it, or replacing the brand header's background, takes that guarantee with it.
  • Collapsed to 48 the wordmark is replaced by mark, so the mark has to still identify the product. A letter does; an abstract glyph on its own does not.
  • The brand header is not a control. If it should navigate home, the product wraps it in a link — it does not become one by sitting at the top.

Where it is drawn

Figma — structure from figma, measurements from figma.

Open in Storybook

On this page