# menuKeys

> Why JS: the WAI-ARIA menu pattern requires roving tabindex, arrow-key navigation, Home/End, and typeahead, which HTML does not provide.

```ts
import { menuKeys } from "@sdxc/ui/mixins";
```

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

```ts
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

```tsx
<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.

### MenuKeys.Options

Configuration accepted by menuKeys.

#### Members

| 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. |
