Menu
A wrapper around React Aria’s MenuTrigger and Menu components. Supports single and
multiple selection, disabled items, and full keyboard navigation.
Add via CLI
Section titled “Add via CLI”npx @a2ra/cli add menuWith selection
Section titled “With selection”Example JSON
Section titled “Example JSON”{ "type": "Menu", "props": { "triggerLabel": "Actions", "items": [ { "id": "edit", "label": "Edit" }, { "id": "duplicate", "label": "Duplicate" }, { "id": "delete", "label": "Delete" } ], "disabledKeys": ["delete"] }}| Prop | Type | Description |
|---|---|---|
triggerLabel | string | Label for the trigger button |
items | MenuItemEntry[] | Menu items (see below) |
placement | topbottom defaultleftright | Preferred menu position |
isOpen | boolean | Controlled open state |
selectionMode | none defaultsinglemultiple | Selection behaviour |
selectedKeys | string[] | Controlled selected item IDs |
defaultSelectedKeys | string[] | Uncontrolled default selection |
disabledKeys | string[] | IDs of non-interactive items |
MenuItemEntry shape
Section titled “MenuItemEntry shape”| Field | Type | Description |
|---|---|---|
id | string | Unique item identifier |
label | string | Visible item text |
isDisabled | boolean | Disables this item |
- Arrow keys navigate items;
EnterorSpaceactivates the focused item. selectionMode: "none"(default) is for action menus. Use"single"or"multiple"for menus that represent a persistent state choice (e.g. view mode).