Default
Show the codeHide the code
Default, code
<NavItem href="#profile" icon={User}>Profile</NavItem>A link in a settings or section sidebar, with an optional icon and count; the current page is filled brand-subtle at the heavier weight.
Still previews of the real component, rendered from its stories. Pro code isn’t public, so nothing in them responds. Switch the theme and density for every preview at once.
Default, code
<NavItem href="#profile" icon={User}>Profile</NavItem>Settings nav, code
<nav aria-label="Settings">
<ul className="flex flex-col gap-0.5">
<li><NavItem href="#profile" icon={User} isCurrent>Profile</NavItem></li>
<li><NavItem href="#notifications" icon={Bell} count={3} countLabel="unread">Notifications</NavItem></li>
<li><NavItem href="#security" icon={Shield}>Security</NavItem></li>
<li><NavItem href="#billing" icon={CreditCard}>Billing</NavItem></li>
<li><NavItem href="#team" icon={Users} count={12} countLabel="members">Team</NavItem></li>
</ul>
</nav>The 14 design tokens NavItem reads, with the value each has in the theme and density chosen above. Change a token and the component follows, in Figma and in code.
| Token | Value now | CSS variable |
|---|---|---|
| color.bg.brand-subtle | … | --sd-color-bg-brand-subtle |
| color.bg.brand-subtle-hover | … | --sd-color-bg-brand-subtle-hover |
| color.bg.muted | … | --sd-color-bg-muted |
| color.bg.subtle | … | --sd-color-bg-subtle |
| color.icon.brand | … | --sd-color-icon-brand |
| color.icon.default | … | --sd-color-icon-default |
| color.text.default | … | --sd-color-text-default |
| color.text.secondary | … | --sd-color-text-secondary |
| motion.duration.fast | … | --sd-motion-duration-fast |
| motion.easing.standard | … | --sd-motion-easing-standard |
| shape.radius-control | … | --sd-shape-radius-control |
| spacing.gap.sm | … | --sd-spacing-gap-sm |
| spacing.inset.sm | … | --sd-spacing-inset-sm |
| target.min | … | --sd-target-min |
Pro components come as source from the SuperDuper registry, with a licence key from Solo, Team or Studio. The registry and checkout aren’t open yet.
Add it from the registry (Pro licence key)
npx shadcn@latest add @superduperui/nav-itemThen import it
import { NavItem } from "@/components/ui/nav-item"| Prop | Type | What it does |
|---|---|---|
hrefrequired | string | Where the link goes. |
childrenrequired | ReactNode | The visible label ("Profile"). |
icon | LucideIcon | A decorative Lucide icon before the label. |
count | string | number | A count after the label ("3"), read after it. |
countLabel | string | What the count counts, read after the number by screen readers ("3 unread"). Use it whenever the count is a bare number. |
isCurrent | booleanDefault false | The page this link points to is the one on screen: aria-current="page", a brand-subtle fill and the heavier weight. |
Screen readers announce "Notifications 3 unread, link" (the current one adds "current page").
WCAG 2.2 AAA criteria the component meets in Comfortable density: 1.4.6, 1.4.9, 2.1.3, 2.4.13, 2.5.5.
Items are 44px in Comfortable and 24px in Compact (AA).
| axe-core (WCAG A, AA, AAA and best practice) | 60 runs across every story, theme, density and width: 0 violations |
|---|---|
| Rendered text contrast | 140 text runs: 0 below 7:1, lowest 11.42:1 |
| Target size | 32 targets: 0 under 44px in Comfortable |
| Focus appearance (2.4.13) | 90 focus stops in 3 browser engines: all pass |
| Keyboard script | Chromium 4 of 4, Firefox 4 of 4, WebKit 4 of 4 |
Manual passes with VoiceOver and NVDA haven’t been done yet.
Each step is scripted and run in Chromium, Firefox and WebKit.
| Key | What happens |
|---|---|
| Tab | Tab reaches the first link, the current page |
| Tab | Tab moves to the next link; its count is part of the name |
| Tab | Tab moves on in order |
| Shift+Tab | Shift+Tab moves back |
The Figma component is NavItem, with Current (False, True); State (Default, Hover, Focus). The Figma library isn’t published yet.
Figma to code: Current (False, True = isCurrent); State (Default, Hover, Focus; preview only); Label → children; Icon → icon when Show icon; Count → count when Show count.