Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-menu-item>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

Interactive menu item for <mth-dropdown-menu> supporting normal, checkbox, radio, keyboard shortcuts, and nested submenus.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-menu-item> (@methane-ui/ui)
Menu ItemsFormat Spec (Target)Auto-SaveExport CEM JSON
Ready · interact with <mth-menu-item>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/menu-item"></script>
<mth-menu-item type="normal" item-role="auto">Example</mth-menu-item>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Machine value emitted in mth-select event detail.
typetype'normal' | 'checkbox' | 'radio'"normal"Item semantics (normal | checkbox | radio).
checkedcheckedbooleanfalseChecked/selected state for checkbox and radio items.
disableddisabledbooleanfalseDisables activation and skips keyboard focus.
shortcutshortcutstring""Displayed keyboard shortcut label.
groupgroupstring""Logical radio group identifier shared across sibling radio items.
activeactivebooleanfalseMarks whether the item is currently highlighted.
submenuOpensubmenu-openbooleanfalseControls visibility of the nested slot="submenu" panel.
itemRoleitem-role'auto' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option'"auto"Overrides computed ARIA role (e.g., option when hosted in a listbox menu).

Events

EventDetail TypeDescription
mth-select{ value: string; checked: boolean }Fired when the item is activated via click or keyboard.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
Enterbothenabledactivates item or toggles checked state
bothenabledactivates item or toggles checked state
ArrowRightbothLTR and item has submenuopens nested submenu
ArrowLeftbothLTR and submenu is opencloses nested submenu

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none" with host role="menuitem".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 4 APG keyboard transitions across LTR/RTL.mth-menu-item.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(checked), :state(disabled), :state(active), :state(submenu-open).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test