NavMenu
moleculeHierarchical navigation for sidebar and top-bar layouts with a DOM-driven sliding highlight pill. Compound API with Item, Group, Sub, and Separator. Three highlight states (child active, collapsed-with-active-child, self-active parent), CSS hover with translucent tint, inverse mode with accent right-border, three sizes, and collapsible groups with height animation.
Basic sidebar
Vertical navigation with groups and active state.
Inverse mode
Surface background with accent right-border for tinted chrome.
Sizes
Small, medium, and large navigation items.
Usage
Installation
API Reference
NavMenu props — * required
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "vertical" | "horizontal" | "vertical" | Layout direction. |
inverse | boolean | false | Surface background with accent right-border and elevation shadow. |
size | "sm" | "md" | "lg" | "md" | Text and padding size. |
hasIcons | boolean | false | Controls left-padding alignment for icon consistency. |
aria-label | string | — | Accessible label for the nav element. |
style | React.CSSProperties | — | Custom styles for the root element. |
NavMenu.Item | compound | — | Navigation item. Props: href, isActive, icon, badge, onClick, disabled, as, children. |
NavMenu.Group | compound | — | Collapsible group with header. Props: label, defaultOpen, icon, children. |
NavMenu.Sub | compound | — | Nested submenu with horizontal dropdown and viewport collision detection. Props: label, icon, children. |
NavMenu.Separator | compound | — | Visual separator between items. |