[ @sdxc/ui/mixins ]
menuKeys
Why JS.
import { menuKeys } from "@sdxc/ui/mixins";Usage
Adapts the WAI-ARIA menu keyboard pattern — roving tabindex, arrow-key
navigation, Home/End, and typeahead — onto a Menu surface's
[role^="menuitem"] descendants; only manages focus, leaving activation to native semantics.
Signature
menuKeys(options?: MenuKeys.Options): MixinDescriptor<HTMLElement>Returns a mixin descriptor for the Menu surface's mix prop.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | MenuKeys.Options | Item-selector override for non-standard markup. |
Examples
<Menu.List mix={menuKeys()}>
<Menu.Item>Rename</Menu.Item>
<Menu.Item>Delete</Menu.Item>
</Menu.List>Used with it
The events, constants and types its module publishes, each imported from @sdxc/ui/mixins too.
Interface
MenuKeys.Options
Configuration accepted by menuKeys.
| Member | Type | Description |
|---|---|---|
itemSelector? | string | Selector, evaluated against the Menu surface's descendants, that identifies its menu items. Defaults to [role^="menuitem"], matching the menuitem, menuitemcheckbox, and menuitemradio roles. |