- Implementation
Common Examples
To use theMenu, pass a Carto Button through trigger and configured MenuOption objects through items. The kit forbids composed menu-item children.Selection
The defaultselectionMode="none" creates an action menu that closes after activation. Use "single" or "multiple" for persistent checked selections.Icons and disabled options
Pass an icon from@servicetitan/anvil2-icons through an option’s icon field. Set isDisabled on an option to prevent focus, selection, and activation.Link options
Passhref to render an option as a navigation link. An option with target="_blank" receives a safe rel default and a localized new-tab announcement.Placement and long lists
placement opens the popover above or below its trigger with a fixed 4px gap. Long labels wrap at the 360px width ceiling, and long lists scroll within available viewport height.Internationalization
Menu option labels are consumer content and must be localized before they are passed initems. External link options use ai-kit.menu.opensInNewTab for the hidden new-tab announcement.React Accessibility
- React Aria supplies keyboard navigation, typeahead, focus management, and selection semantics.
- Arrow keys move between options. Enter or Space activates the focused option. Escape closes the menu and restores focus to the trigger.
- External link options include a localized hidden new-tab announcement.