Navigation

SideNavigation

Vertical navigation column that hosts grouped side-navigation-item entries with a required accessible label for the landmark.

import { SideNavigation } from '@lostgradient/cinder';
navigationsidebar
01

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.

svelte
<script lang="ts">
  import { SideNavigation } from '@lostgradient/cinder';
</script>

<SideNavigation ariaLabel="Workspace">
  <SideNavigation.Item href="/dashboard">Dashboard</SideNavigation.Item>
  <SideNavigation.Group label="Projects">
    <SideNavigation.Item href="/projects/phoenix" active>Phoenix</SideNavigation.Item>
    <SideNavigation.Item href="/projects/atlas">Atlas</SideNavigation.Item>
  </SideNavigation.Group>
</SideNavigation>

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.

svelte
<script lang="ts">
  import { SideNavigation } from '@lostgradient/cinder';
</script>

<SideNavigation ariaLabel="Workspace">
  {#snippet brand()}Corvidae{/snippet}
  {#snippet primaryAction()}
    <button type="button" aria-keyshortcuts="N">
      New chat
      <span data-cinder-shortcut aria-hidden="true">N</span>
    </button>
  {/snippet}
  <SideNavigation.Item href="/" active>Home</SideNavigation.Item>
</SideNavigation>
Live preview

Basic side navigation

02

When to use

Use when
  • Building a tall, dense application sidebar with many sections and nested groups.
  • Pairing with sidebar so the column collapses responsively on narrow viewports.
Avoid when
03

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.

Compact sidebar spacing

Dense sidebars can tune the SideNavigation list gap through a public CSS variable.

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.

Docs sidebar

Documentation sidebar with grouped navigation sections. The active item receives aria-current="page".

04

Props

Props for side-navigation
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.