Action menu
Action menu is composed of action list and overlay patterns used for quick actions and selections.
On this page
- @primer/react@37.8.0
- Beta
- Not reviewed for accessibility
On this page
Import
import {ActionMenu} from '@primer/react'
Examples
Props
ActionMenu
| Name | Default | Description |
|---|---|---|
childrenRequired | React.ReactElement[]Recommended: | |
open | false | booleanIf defined, will control the open/closed state of the overlay. Must be used in conjuction with |
onOpenChange | (open: boolean) => voidIf defined, will control the open/closed state of the overlay. Must be used in conjuction with | |
anchorRef | React.RefObject<HTMLElement>Useful for defining an external anchor |
ActionMenu.Button
| Name | Default | Description |
|---|---|---|
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
| Name | Default | Description |
|---|---|---|
childrenRequired | React.ReactElementAccepts a single child element | |
id | string |
ActionMenu.Overlay
| Name | Default | Description |
|---|---|---|
childrenRequired | React.ReactNode | |
align | start | start | 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 | unknownID 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. | ||