Overview
Collapsible group header that organises related items within a side navigation.
Usage
SideNavigationGroup is a compose-only leaf of SideNavigation. The idiomatic API is SideNavigation.Group, reached through the parent namespace — see the side-navigation README for the composed snippet. The leaf is also a named export of @lostgradient/cinder.
Sections with no visible heading
An app's main navigation often reads better as sections kept apart by space alone. Set collapsible={false} and labelVisibility="hidden": the group renders no header, the label becomes the list's aria-label so a screen reader still hears "Work" or "System", and one gap above the list separates it from the section before. labelVisibility does nothing on a collapsible group, whose trigger is its label.
When to use
- Splitting a long side-navigation column into clearly named sections.
- Letting users collapse rarely used groups to reduce visual noise in the sidebar.
- Sectioning an app's navigation with no visible headings: collapsible false plus labelVisibility hidden keeps the name for screen readers.
- Used outside a side-navigation ancestor — it expects that landmark for context.
- Hosting a single flat list with no grouping — place side-navigation-item entries directly.
Props
Name | Type | Default | Description |
|---|---|---|---|
label required | text | The section's name: its visible header, or with labelVisibility: 'hidden' the list's accessible name. | |
id | text | Optional stable id for the root <li>. Trigger uses ${id}-trigger, panel uses ${id}-panel. If omitted, generated via useId. | |
collapsible | boolean | true | Whether the group opens and closes. Default: true. Set false for a static section: its label
is plain text over an always-visible list, and in a collapsed sidebar the label gives way to
a hairline between sections. expanded and disabled do nothing on a static group. |
labelVisibility | 'visible' | 'hidden' | 'visible' | Whether a static group draws its label. Default: 'visible'. 'hidden' renders no header at
all: the label becomes the list's aria-label, so a screen reader still hears the section's
name, and sighted users see the sections apart by one gap. It does nothing on a collapsible
group, whose trigger is its label. |
expanded bindable | boolean | true | Whether the group is expanded. Bindable. Default: true. |
disabled | boolean | false | When true, the disclosure button is disabled. Default: false. |
disabledReason | text | One reason that covers the group's disabled rows ("Choose a connection first"), drawn once
between the group's header and its rows, in the disabled colour at the extra-small size, and
the description of every disabled row in the group. A row draws its own disabledReason only
when it says something different; a row that repeats the group's reason draws nothing. It is
hidden with the rows while the group is collapsed, and clipped in a collapsed icon rail, where
it stays the rows' description. | |
icon | snippet | Optional leading icon rendered inside the header button before the label. | |
badge | snippet | Optional trailing badge rendered inside the header button after the label, before the chevron. | |
children required | snippet | Must be <li>-wrapped NavigationItems (or SideNavigationItems) rendered inside the disclosed <ul>. |