Overview
Individual link within a side navigation, supporting nesting and active highlighting.
Usage
SideNavigationItem is a compose-only leaf of SideNavigation. The idiomatic API is SideNavigation.Item, reached through the parent namespace — see the side-navigation README for the composed snippet. The leaf is also a named export of @lostgradient/cinder.
Rows, counts and the collapsed rail
A row is one 30px control (44px under a coarse pointer): hover, focus and the active fill paint the whole row. Default text is secondary with no fill; hover gives a lighter neutral tint and primary text; the active row is a flat soft accent-tinted fill with no shadow, default text, semibold weight and aria-current="page" and takes no hover change, because accent text is for actions and links; keyboard focus draws the quiet ring around the whole row.
- Count: a count is plain, muted, 13px text at the trailing edge of the row, never a badge. On the icon rail it becomes a small dot on the icon's corner.
- Badge:
badge="Plugin"marks the kind of entry with a neutral extra-smallBadgeat the trailing edge, where the count sits. It is mutually exclusive withcountanddot: a row with a badge reports neither. The label ends in an ellipsis on one line before the badge, which is never cut, and the row keeps its height. The badge joins the accessible name and tooltip in lower case ("Reports, plugin"), and a collapsed row draws no badge, since its tooltip says the same. - Accessible name: with
labeland a non-zerocount, the link is named"Health, 3 need attention"or"Reviews, 2 need you". The count and the dot are hidden from assistive technology, so colour is never the only signal. - Tooltip: a row with a count shows its name as a tooltip on hover and focus (
"Health, 3 need attention"). A collapsed row shows"Reviews, 2 need you", or the label alone when there is no count. - Collapsed rail: inside a
Sidebara row follows the sidebar's collapsed state on its own (passcollapsedto override). A row with aniconbecomes a 40px target: the label is clipped but stays in the accessible name, and the count or dot moves onto the icon's corner. A row withouticonis unchanged. - Do not also set
title: the browser would show its own tooltip beside this one.
When to use
- Rendering one entry inside a side-navigation column or side-navigation-group.
- Keeping list semantics correct so screen readers announce sidebar entry counts.
- Placing entries in a horizontal navigation-bar — use navigation-item directly.
- Rendering outside a side-navigation list — use navigation-item without the list wrapper.