@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginalInteractive 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.
Multi-Framework Playground & Snippets
Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|
value | value | string | "" | Machine value emitted in mth-select event detail. |
type | type | 'normal' | 'checkbox' | 'radio' | "normal" | Item semantics (normal | checkbox | radio). |
checked | checked | boolean | false | Checked/selected state for checkbox and radio items. |
disabled | disabled | boolean | false | Disables activation and skips keyboard focus. |
shortcut | shortcut | string | "" | Displayed keyboard shortcut label. |
group | group | string | "" | Logical radio group identifier shared across sibling radio items. |
active | active | boolean | false | Marks whether the item is currently highlighted. |
submenuOpen | submenu-open | boolean | false | Controls visibility of the nested slot="submenu" panel. |
itemRole | item-role | 'auto' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option' | "auto" | Overrides computed ARIA role (e.g., option when hosted in a listbox menu). |
Events
| Event | Detail Type | Description |
|---|
mth-select | { value: string; checked: boolean } | Fired when the item is activated via click or keyboard. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|
| Enter | both | enabled | activates item or toggles checked state |
| | both | enabled | activates item or toggles checked state |
| ArrowRight | both | LTR and item has submenu | opens nested submenu |
| ArrowLeft | both | LTR and submenu is open | closes nested submenu |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none" with host role="menuitem". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 4 APG keyboard transitions across LTR/RTL. | mth-menu-item.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(checked), :state(disabled), :state(active), :state(submenu-open). | Conformance suite |
| i18n | Routes 1 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |