Menu
Popover action list with roving-tabindex keyboard navigation and a danger item variant.
Preview
Row actions
API
React props (NxKit)
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
items | NxMenuItem[] | — | Required | label/icon/active/onClick/separator/disabled/danger per item. |
onClose | ()=>void | undefined | Called on Escape — the consumer restores focus to the trigger. | |
autoFocus | boolean | false | Focus the first non-disabled item on mount. |
Classes
| Class | Description |
|---|---|
.nx-menu | role=menu popover, overlay shadow |
.nx-menu__item | role=menuitem button |
.nx-menu__item--active | Accent tint + weight |
.nx-menu__item--danger | Danger text, danger-tint hover |
.nx-menu__item--disabled | aria-disabled, skipped by roving nav |
.nx-menu__sep | role=separator divider |
Accessibility
- role="menu" / items role="menuitem"; one roving tab stop (first non-disabled item), ArrowUp/Down wrap, Home/End, Escape calls onClose.
- Disabled items are aria-disabled (not the disabled attribute, since they're <button type="button"> acting as menu items) and are skipped by the roving walk.
Do / Don’t
- Do: Put destructive actions last, marked danger.Don’t: Don't put more than ~8 items in one menu — group or paginate.