An item within a nana-menu: icon + label + shortcut, with selected (checkmark), destructive, disabled and submenu states. Renders as a button, or a link when href is set, and bubbles nana-select.
Item one
Item two
Show code Copy < nana-menu style = "max-width:220px" >
< nana-menu-item >Item one</ nana-menu-item >
< nana-menu-item >Item two</ nana-menu-item >
</ nana-menu >
npm install @nana-tec/ui-components
import " @nana-tec/ui-components/menu-item " ;
< nana-menu style = " max-width:220px " >
< nana-menu-item > Item one </ nana-menu-item >
< nana-menu-item > Item two </ nana-menu-item >
Items support active, selected, shortcut, destructive, and a prefix
icon slot.
Home
Copy
Delete
Show code Copy < nana-menu bordered style = "width:15rem" >
< nana-menu-item value = "home" active >Home</ nana-menu-item >
< nana-menu-item value = "copy" shortcut = "⌘C" >
< nana-icon slot = "prefix" name = "content_copy" ></ nana-icon >
Copy
</ nana-menu-item >
< nana-menu-item value = "delete" destructive shortcut = "⌘⌫" >Delete</ nana-menu-item >
</ nana-menu >
Properties Property Attribute Type Default Description active— booleanfalseHighlight as the current item (soft) destructive— booleanfalseRender in a destructive (danger) style disabled— booleanfalseDisable the item href— string | undefined—Render as a link selected— booleanfalseChosen state — accent fill + checkmark shortcut— string | undefined—Keyboard shortcut shown on the right submenu— booleanfalseShow a trailing submenu arrow value— string''Value emitted on selection
Events Event Description nana-selectFired on activation (`detail.value`)
Slots Slot Description (default)The label prefixLeading icon (~20px) suffixTrailing content (falls back to the `shortcut` attribute)
CSS parts Part Description ::part(item)The interactive row
CSS custom properties Property Description --nana-menu-on-accentText colour on the highlighted/selected row
Event Type Description nana-selectCustomEventFired on activation (detail.value)
Slot Description (default)The label prefixLeading icon (~20px) suffixTrailing content (falls back to the shortcut attribute)
Variable Default Description --nana-menu-on-accent— Text colour on the highlighted/selected row
Part Description itemThe interactive row (<a> or <button>)
Explore Menu Item interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook