ActionMenu
Used to render a list of items that is selectable combined with a submit buton.
Anatomy
- Trigger
- Container
- Menu
- Menu Item
- Check Icon (optional)
- Label Text
- Label Description (optional)
Import
import {
MenuProvider,
MenuList,
MenuOption,
ActionMenuButton,
} from '@pluralsight/react'
Usage
Basic
Customizing
When you want to customize the Menu or ActionMenu family of components, you can use any of the native React features to overwrite styling for the elements.
Behavior
Do: use the ActionMenu component to display a list of selectable options.
Don't: use the ActionMenu component to display a list of navigation links. Instead use the Menu component.
API
This API is extended from the Menu Components.
ActionMenuButton
The ActionMenuButton
component is used to render a two button group. The first button is the submit button and the second is the trigger that opens/closes the menu.
Props
Prop | Type | Description |
---|---|---|
name | string | The form name for the submit button element. |
value | string | The form value for the submit button element. |
Accessibility
The ActionMenu/Menu component is built to be accessible to screen readers and keyboard users alike.
Screen Reader Interactions
Screen readers will announce the following:
- Announce the role of the component
- Announce the number of options available
- Announce the selected option
Keyboard Interactions
Menu Button
Key | Description |
---|---|
Tab | Moves focus to the next focusable element. |
Enter | Submits the form using the ActionMenu. |
Menu Trigger
Key | Description |
---|---|
Tab | Moves focus to the next focusable element. |
Space | Opens the Menu. |
Enter | Opens the Menu. |
Menu
Key | Description |
---|---|
Tab | Moves focus to the next focusable element. |
Shift + Tab | Moves focus to the previous focusable element. |
Left Arrow | Moves focus to the previous Option. |
Right Arrow | Moves focus to the next Option. |
Home | Moves focus to the first Option. |
End | Moves focus to the last Option. |
Space | Selects the current Option. |
Enter | Selects the current Option. |