Menu Item

Individual item within a menu component. Can include icons and display selected state.

Overview

size
tiny · small · medium
Toggles
isSelected, isActive

All options

Size and state

isActive is the keyboard highlight used by Select's listbox.

size \ statedefaultisSelectedisActive
medium
small
tiny

Content

content \ sizemediumsmalltiny
label only
iconName
iconRight
tag
tag with icon
secondLabel
userImgUrl

Tag color and variant

tag.color \ tag.variantcontainedtextOnlydot
default
success
warning
error
info

Examples

With all props

Long text with truncation

Accessibility

Role

A menu item has role="menuitem" by default. Select passes role="option", which also sets aria-selected from isSelected.

Keyboard

The item is focusable and Enter or Space activates it. With href, the item is wrapped in a link that takes focus instead.

Props

PropTypeRequiredDescription
hrefstringNo—
iconNamestringNo—
iconReact.ReactNodeNo—
userHandlestringNo—
userImgUrlstringNo—
labelstringYes—
secondLabelstringNo—
isSelectedbooleanNo—
onClickanyNo—
classNamestringNo—
size'tiny' | 'small' | 'medium'No—
tag{ label: React.ReactNode; iconName?: string; color?: 'default' | 'success' | 'warning' | 'error' | 'info'; variant?: 'contained' | 'textOnly' | 'dot'; }No—
iconRightstringNo—
rightActionReact.ReactNodeNo—
rolestringNoARIA role; Select passes 'option'. Defaults to 'menuitem'.
idstringNo—
isActivebooleanNoKeyboard highlight used by Select's listbox
tabIndexnumberNoSelect keeps focus on its trigger and passes -1