Menu

A flexible menu component that provides a list of selectable items. Items can be simple labels or actionable links.

Usage

Basic Menu

Render the Menu with a list of MenuItemProps:

<Menu.Root defaultValue="home">
<Menu.Item value={'home'} label={'Home'} />
<Menu.Item value={'about'} label={'About'} />
</Menu.Root>

Menu using Items

Use Menu with items prop data

<Menu.Root
items={[
{ value: 'home', label: 'Home', href: '#home' },
{ value: 'about', label: 'About', href: '#about' },
]}
defaultValue="home"
/>

Menu with Icons

Include icons before or after menu items:

<Menu.Root
items={[
{ value: 'home', label: 'Home', href: '#home', iconPrepend: <Icon type="Home" /> },
{ value: 'about', label: 'About', href: '#about', iconAppend: <Icon type="HelpCircle" /> },
]}
defaultValue="home"
/>

API

Props

Menu

PropTypeDefaultRequired
itemsMenuItemProps[]-Yes
defaultValuestring-Yes
justify'start' | 'center' | 'end''start'-
MarginPropsToken<MarginProps>--
colorThemeAccentColor--
radiusThemeRadius--
sizeResponsive<Size>'medium'-
highContrastboolean--

Menu Item

PropTypeDefaultRequired
labelReactNode-Yes
onClick() => void--
hrefstring--
iconPrependReactNode--
iconAppendReactNode--
colorThemeAccentColor--
radiusThemeRadius--
sizeResponsive<Size>'medium'-
highContrastboolean--
Icon Menu
Previous
Pagination
Next