Action menu

Use the action menu component to display a list of actions or selections that expand through a trigger button.
  • Experimental
  • Not reviewed for accessibility
import {ActionMenu} from '@primer/react-brand'

Examples

Default

Single selection

Component props

ActionMenu Required

nametypedefaultrequireddescription
disabledbooleanfalsefalseControls the ActionMenu active/inactive state
openbooleanfalsefalseDetermines whether the ActionMenu is open by default
onSelect(newValue: string) => voidfalseCallback that is called when an item is selected
selectionVariant'single'
'none'
'none'falseThe selection variant of the ActionMenu
menuAlignment'start'
'end'
'start'Horizontal alignment of the menu relative to the bottom of the button

ActionMenu.Button Required

nametypedefaultrequireddescription
classNamestringSets a custom class on the element
childrenReactElement
idstringSets a custom id

ActionMenu.Overlay Required

nametypedefaultrequireddescription
aria-labelstringtrueRequired for describing the relationship between button and menu
classNamestringSets a custom class on the element
childrenReactElement
idstringSets a custom id

ActionMenu.Item Required

nametypedefaultrequireddescription
classNamestringSets a custom class on the element
childrenReactElement
disabledbooleanfalsefalseAllows control over an individual items active/inactive state
idstringSets a custom id
selectedbooleanIndicates the item is selected in single selection mode
valuestringThe underlying value passed to the selection handler