Menu

Navigation menu component with collapsible groups, icons, and hierarchical structure. Built on the Accordion component with support for up to 3 levels of nesting.

Basic Usage
JSX
<Menu>
  <MenuGroup label="Dashboard" open>
    <MenuItem active icon={<Icon name="home" />}>
      Overview
    </MenuItem>
    <MenuItem icon={<ChartIcon />}>
      Analytics
    </MenuItem>
  </MenuGroup>
  <MenuGroup label="Settings">
    <MenuItem icon={<UserIcon />}>
      Profile
    </MenuItem>
  </MenuGroup>
</Menu>

Show Count Options

Control when item counts are displayed using the showCount prop on MenuGroup.

showCount="always"
showCount="collapsed-only"
showCount="never"

Nested Groups (Up to 3 Levels)

Menu supports up to 3 levels of nesting. Visual hierarchy is conveyed through typography (UPPERCASE for top-level, capitalized for nested) rather than indentation.

JSX
<Menu>
  <MenuGroup label="Components" showCount="never" open>
    <MenuGroup label="Input" showCount="collapsed-only">
      <MenuItem icon={<Icon name="input" />}>Text</MenuItem>
      <MenuItem icon={<Icon name="hash" />}>Number</MenuItem>
    </MenuGroup>
    <MenuGroup label="Output" showCount="collapsed-only">
      <MenuItem icon={<Icon name="grid" />}>Cards</MenuItem>
    </MenuGroup>
  </MenuGroup>
</Menu>

Interactive Example

Click on menu items to see the active state change.

Active: /dashboard

With Dividers

Disabled States

Both MenuGroup and MenuItem support disabled states.

Best Practices

Do

Use icons consistently across all items
Group related items together logically
Use showCount for groups with variable content
Keep labels short and descriptive

Don't

Nest more than 3 levels deep
Mix icons and no-icons in same group
Create empty groups without content
Use overly long menu item labels

Props Reference

MenuGroup

PropTypeDefaultDescription
labelstring-Group header label (required)
openbooleantrueControlled open state
onOpenChange(open: boolean) => void-Callback when open state changes (makes group collapsible)
showCount'always' | 'collapsed-only' | 'never''never'When to show item count

MenuItem

PropTypeDefaultDescription
asReact.ElementType-Polymorphic element type (e.g., Link, 'a')
iconReact.ReactNode-Icon to display
activebooleanfalseActive/selected state
disabledbooleanfalseDisable the item
onClick(e: MouseEvent) => void-Click handler