Action menu
Use the action menu component to display a list of actions or selections that expand through a trigger button.
import {ActionMenu} from '@primer/react-brand'
In single selection mode it is important to apply an aria-label
to the
ActionMenu.Button
child. This provides the user with important and durable
context on the selection they need to make.
ActionMenu
is currently available in small
and medium
sizes, with the latter being the default.
name | type | default | required | description |
---|---|---|---|---|
disabled | boolean | false | false | Controls the ActionMenu active/inactive state |
open | boolean | false | false | Determines whether the ActionMenu is open by default |
onSelect | (newValue: string) => void | false | Callback that is called when an item is selected | |
selectionVariant | 'single' 'none' | 'none' | false | The selection variant of the ActionMenu |
menuAlignment | 'start' 'end' | start | false | Horizontal alignment of the menu relative to the bottom of the button |
size | 'small' 'medium' | medium | false | Size configuration of the ActionMenu |
menuSide | 'inside-top' 'inside-bottom' 'inside-left' 'inside-right' 'inside-center' 'outside-top' 'outside-bottom' 'outside-left' 'outside-right' | undefined | false | Location of the menu overlay |
name | type | default | required | description |
---|---|---|---|---|
className | string | Sets a custom class on the element | ||
children | ReactElement | |||
id | string | Sets a custom id |
name | type | default | required | description |
---|---|---|---|---|
aria-label | string | true | Required for describing the relationship between button and menu | |
className | string | Sets a custom class on the element | ||
children | ReactElement | |||
id | string | Sets a custom id |
name | type | default | required | description |
---|---|---|---|---|
className | string | Sets a custom class on the element | ||
children | ReactElement | |||
disabled | boolean | false | false | Allows control over an individual items active/inactive state |
id | string | Sets a custom id | ||
selected | boolean | Indicates the item is selected in single selection mode | ||
value | string | The underlying value passed to the selection handler |