Overview
Reference usage
Vertical navigation panel for secondary or hierarchical app destinations.
See the SideNavigation versus Sidebar decision for the boundary between the accessibility-focused nav landmark here and the responsive shell in Sidebar.
Usage
SideNavigation is a compound component. Import the parent and compose SideNavigation.Group and SideNavigation.Item via the namespace API.
The leaves are also named exports of @lostgradient/cinder.
brand and primaryAction are slots above the list. The sidebar is a soft tonal surface with no rule beside it, and the current row is a raised white pill with default text, because the accent is for actions and links. The primary action is one <a> or <button>, drawn as a neutral control the width of the sidebar: a leading accent "+", its label, and the shortcut glyph at the trailing edge as plain text with no key cap. The count on a row is plain muted text at the trailing edge, never a badge.
When to use
- Building a tall, dense application sidebar with many sections and nested groups.
- Pairing with sidebar so the column collapses responsively on narrow viewports.
- Anchoring primary navigation across the top of the page. Use Navigation Bar instead
- Rendering a single flat horizontal nav row. Use Navigation Bar instead
- Showing an in-page heading outline. Use Table Of Contents instead
- Rendering expandable hierarchical non-navigation data. Use Tree instead
- Needing the shell. Use Sidebar instead
Examples
Basic side navigation
A grouped sidebar nav. Uses the SideNavigation namespace API: SideNavigation.Group wraps a collapsible section and SideNavigation.Item renders each link.
Counts, dot and icon rail
A row can carry a count pill or a status dot, and its accessible name carries the count ("Health, 3 need attention") so colour is never the only signal. Collapsed to an icon rail, the label leaves the screen, stays in the name, and appears in a tooltip.
Props
Name | Type | Default | Description |
|---|---|---|---|
ariaLabel required | text | Accessible name for the <nav> landmark. Required, non-empty, distinct from other navs on the page. | |
brand | Snippet | undefined | The product's name, mark or workspace switcher, drawn above the primary action and the list. Wrap it as you like; the slot adds only the padding that aligns it with the rows. | |
primaryAction | Snippet | undefined | The one action the product leads with ("Capture", "New chat"), drawn under brand and above
the list. Render a single <a> or <button>: it is drawn as a neutral, sidebar-wide control
with a leading accent "+", its label, and, for an element with data-cinder-shortcut, the
shortcut glyph at the trailing edge as plain text with no key cap. It is never a full-width
accent slab. Name the shortcut for assistive technology with aria-keyshortcuts on the
control, and mark the glyph aria-hidden. | |
children required | snippet | Must be <li> elements containing NavigationItem and/or SideNavigationGroup. |