App components / Navigation
Sidebar
The app's main navigation: the workspace switcher on top, labelled sections of nav items with counters, badges and sub items, and a collapse button that folds it to icons. The current page sits on a raised card with its icon in the accent.
MembersReact · Vue · HTMLFigma: Navigation
Code
The component itself, ready to drop into your project. Switch between React, Vue and plain HTML; every version uses the same Tailwind classes on Ochre's tokens.
Current page
Q3 roadmap
Installation
Examples
Collapsed
Icons with tooltips. The button at the bottom unfolds it.
Nav items, sub items and sections
Every size from S to XXL, with a counter, a badge and a chevron.
Workspace
Motion
Built on Ochre's ease-out curves. With reduced motion switched on, everything still works, it just doesn't move.
01The current page's card glides from row to row with an ease-out.
02Sub items rise into place as a group opens, and its chevron turns with an ease-out.
03Collapsing folds the bar to its icons at once and the card glides to the current icon; labels move into tooltips.
04Rows dip slightly while pressed.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| sections | { label?, onAdd?, items: { id, label, icon?, href?, count?, badge?, children? }[] }[] | – | Groups of links. The first is usually unlabelled; items with children open sub items. |
| value / defaultValue | string | – | The id of the current page. |
| onValueChange | (id: string) => void | – | Called with the item or sub item picked. |
| collapsed / defaultCollapsed | boolean | – | Expanded or Collapsed (icons with tooltips). |
| onCollapsedChange | (collapsed: boolean) => void | – | Called by the collapse button at the bottom. |
| header | ReactNode | – | Usually a WorkspaceSwitcher; it shrinks to its mark when the bar collapses. |
| footer | ReactNode | (collapsed) => ReactNode | – | Help, settings and the signed-in person, above the collapse button. |
| size | "s" | "m" | "l" | "xl" | "xxl" | "s" | Row height: 32, 40, 48, 56 or 64. |
| NavItem | component | – | icon, label, href or onClick, active, count, badge, chevron + expanded, collapsed, size. Default, Hover and Active are real states. |
| NavSubItem | component | – | label, href or onClick, active, size. Sits inside a hairline-guided group under its parent. |
| NavSection | component | – | label, onAdd (a small + on the label row), collapsed. |
| WorkspaceSwitcher | component | – | The Space switcher without member counts: spaces, value, onValueChange, onCreate. |
Usage
Use it for
- Apps with more than five top-level places, or places that nest (projects, then their views).
- Desktop layouts. On phones use a Mobile tab bar and Mobile header instead.
Avoid
- Fewer than five sections: a Rail or a Top bar is lighter.
- Nesting deeper than one level of sub items.
- Colouring each item: only the current page's icon takes the accent.