Skip to content
Nana UI

Navigation

Menu Item

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.

View .md Download
Item one Item two
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
activeactivebooleanfalseHighlight as the current item (soft)
destructivedestructivebooleanfalseRender in a destructive (danger) style
disableddisabledbooleanfalseDisable the item
hrefhrefstring | undefined—Render as a link
selectedselectedbooleanfalseChosen state — accent fill + checkmark
shortcutshortcutstring | undefined—Keyboard shortcut shown on the right
submenusubmenubooleanfalseShow a trailing submenu arrow
valuevaluestring''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
--nana-menu-item-font-sizeItem text size
--nana-menu-item-radiusItem corner radius
--nana-menu-on-dangerText colour used on the danger item's fill
EventTypeDescription
nana-selectCustomEventFired on activation (detail.value)
SlotDescription
(default)The label
prefixLeading icon (~20px)
suffixTrailing content (falls back to the shortcut attribute)
VariableDescription
--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