Action menu

Action menu is composed of action list and overlay patterns used for quick actions and selections.

  • @primer/react@37.8.0
  • Beta
  • Not reviewed for accessibility

Import

import {ActionMenu} from '@primer/react'

Examples

View in Storybook

Props

ActionMenu

NameDefaultDescription
childrenRequired
React.ReactElement[]

Recommended: ActionMenu.Button or ActionMenu.Anchor with ActionMenu.Overlay

open
falseboolean

If defined, will control the open/closed state of the overlay. Must be used in conjuction with onOpenChange.

onOpenChange
(open: boolean) => void

If defined, will control the open/closed state of the overlay. Must be used in conjuction with open.

anchorRef
React.RefObject<HTMLElement>

Useful for defining an external anchor

ActionMenu.Button

NameDefaultDescription
childrenRequired
React.ReactElement
Additional props are passed to the <Button> element. See the docs for Button for a list of props/attributes accepted by the <Button> element.

ActionMenu.Anchor

NameDefaultDescription
childrenRequired
React.ReactElement

Accepts a single child element

id
string

ActionMenu.Overlay

NameDefaultDescription
childrenRequired
React.ReactNode
align
startstart | center | end
side
'outside-bottom'| 'inside-top' | 'inside-bottom' | 'inside-left' | 'inside-right' | 'inside-center' | 'outside-top' | 'outside-bottom' | 'outside-left' | 'outside-right'

Controls which side of the anchor the menu will appear

data-test-id
unknown

ID to use for React testing utilities.

Additional props are passed to the <Overlay> element. See the docs for Overlay for a list of props/attributes accepted by the <Overlay> element.