Menucomponent

Menu({ children }: MenuProps): ReactNode
ParamType
childrenMenuProps
The <MenuItem> entries to list. required
Return
ReactNode
The menu element.

A <menu> list of <MenuItem> children.

  • Renders as a bare <menu> element — semantically equivalent to <ul> per HTML spec but more meaningful for menu contexts. Place inside a <nav> (or use the sidebar-style nav at the layout level) if a navigation landmark is needed.
  • Nested <Menu> instances (typically inside a <MenuItem>) get indented via the .menu .menu CSS rule.

A <menu> list of <MenuItem> children — the container for URL-aware navigation in sidebars, dropdowns, and any other list of links.

Things to know:

  • Renders as a bare <menu> element (semantically equivalent to <ul> but more meaningful for menus). Place it inside a <nav> — or a <SidebarLayout> sidebar, which is already a <nav> landmark — if a navigation landmark is needed.
  • Nesting a <Menu> inside a <MenuItem> gets indented automatically via the .menu .menu descendant rule.

Usage

tsx
import { Menu, MenuItem } from "shelving/ui";

<Menu>
  <MenuItem href="/dashboard">Dashboard</MenuItem>
  <MenuItem href="/users">
    Users
    <Menu>
      <MenuItem href="/users/active">Active</MenuItem>
      <MenuItem href="/users/archived">Archived</MenuItem>
    </Menu>
  </MenuItem>
  <MenuItem href="/settings">Settings</MenuItem>
</Menu>

Styling

VariableStylesDefault
--menu-gapVertical gap between itemsvar(--space-xxsmall)
--menu-fontFont familyvar(--font-body)
--menu-sizeFont sizevar(--size-normal)
--menu-leadingLine heightvar(--leading)
--menu-colorText colourvar(--tint-00)
--menu-nested-spaceBlock margin around a nested submenuvar(--space-xxsmall)
--menu-paddingItem link padding (also insets the nested border)var(--space-xxsmall)
--menu-nested-borderNested submenu left-border widthvar(--stroke-focus)
--menu-nested-color-borderNested submenu left-border colourvar(--tint-50)
--menu-nested-indentNested submenu left paddingvar(--space-xsmall)

Item-state hooks (--menu-hover-*, --menu-proud-*, --menu-active-*, --menu-radius, --menu-focus-border) are documented on <MenuItem>.

Global tokens it reads — the tint ladder --tint-00 / --tint-50, plus --space-xxsmall / --space-xsmall, --font-body, --size-normal, --leading, and --stroke-focus.

Examples

<Menu><MenuItem href="/home">Home</MenuItem></Menu>