Skip to content
Nana UI

Menu Item

View .md Download

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
Terminal window
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>
</nana-menu>

Items support active, selected, shortcut, destructive, and a prefix icon slot.

Home Copy Delete

Properties

PropertyAttributeTypeDefaultDescription
activebooleanfalseHighlight as the current item (soft)
destructivebooleanfalseRender in a destructive (danger) style
disabledbooleanfalseDisable the item
hrefstring | undefinedRender as a link
selectedbooleanfalseChosen state — accent fill + checkmark
shortcutstring | undefinedKeyboard shortcut shown on the right
submenubooleanfalseShow a trailing submenu arrow
valuestring''Value emitted on selection

Events

EventDescription
nana-selectFired on activation (`detail.value`)

Slots

SlotDescription
(default)The label
prefixLeading icon (~20px)
suffixTrailing content (falls back to the `shortcut` attribute)

CSS parts

PartDescription
::part(item)The interactive row

CSS custom properties

PropertyDescription
--nana-menu-on-accentText colour on the highlighted/selected row
EventTypeDescription
nana-selectCustomEventFired on activation (detail.value)
SlotDescription
(default)The label
prefixLeading icon (~20px)
suffixTrailing content (falls back to the shortcut attribute)
VariableDefaultDescription
--nana-menu-on-accentText colour on the highlighted/selected row
PartDescription
itemThe interactive row (<a> or <button>)
Explore Menu Item interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook