Skip to main content
Design system

Coming Soon

This component status is coming soon and indicates a component is in a queue for future work.

Action Menu

ActionMenu description

Bundle size: 0
Install:
npm install @washingtonpost/wpds-ui-kit
|Copy
Usage:
import { ActionMenu } from "@washingtonpost/wpds-ui-kit"
|Copy
Source:  View on Github

Anatomy

Note: Image not to scale

  1. Trigger
  2. Root
  3. Arrow
  4. Content
  5. Item
  6. Portal
  7. Sub
  8. SubContent
  9. SubTrigger
  10. Group
  11. RadioGroup
  12. RadioItem
  13. CheckboxItem
  14. ItemIndicator
  15. Label
  16. Separator

Options

Trigger

The Action List can be triggered with a button, a link, an icon, or similar visual cue.

Density

The following options can be applied to ActionMenu.Content to specify the density of the items: default, loose, and compact.

Portal

Description of portal

Description of sub menu


Behavior

Open

Opens on click

Open

Sub navigation hover


Guidance

Guidance one

Description of guidance one


Accessibility

Keyboard controls

KeyDescription
SpaceWhen focus is on DropdownMenu.Trigger, opens the dropdown menu and focuses the first item. When focus is on an item, activates the focused item.
EnterWhen focus is on DropdownMenu.Trigger, opens the dropdown menu and focuses the first item. When focus is on an item, activates the focused item.
ArrowDownWhen focus is on DropdownMenu.Trigger, opens the dropdown menu. When focus is on an item, moves focus to the next item.
ArrowUpWhen focus is on an item, moves focus to the previous item.
ArrowRight, ArrowLeftWhen focus is on DropdownMenu.SubTrigger, opens or closes the submenu depending on reading direction.
EscCloses the dropdown menu and moves focus to DropdownMenu.Trigger.

API Reference

ActionMenu

PropDescriptionTypeDefaultRequired

ActionMenuRoot

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS
----False
slider
enum
boolean
false False
density
enum
DensityProp
default False
dir
enum
Direction
----False
open
enum
boolean
----False
defaultOpen
enum
boolean
----False
onOpenChange
(open: boolean) => void
----False
modal
enum
boolean
----False

StyledCheckboxItem

PropDescriptionTypeDefaultRequired
onSelect
(event: Event) => void
----False
asChild
enum
boolean
----False
disabled
enum
boolean
----False
textValue
string
----False
checked
enum
CheckedState
----False
onCheckedChange
(checked: boolean) => void
----False
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuCheckboxItem

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
onSelect
(event: Event) => void
----False
asChild
enum
boolean
----False
disabled
enum
boolean
----False
textValue
string
----False
checked
enum
CheckedState
----False
onCheckedChange
(checked: boolean) => void
----False

StyledContent

PropDescriptionTypeDefaultRequired
asChild
enum
boolean
----False
side
enum
bottom | left | right | top
----False
sideOffset
number
----False
align
enum
center | end | start
----False
alignOffset
number
----False
arrowPadding
number
----False
collisionBoundary
enum
Element | Element[]
----False
collisionPadding
enum
number | Partial<Record<bottom | left | right | top, number>>
----False
sticky
enum
always | partial
----False
hideWhenDetached
enum
boolean
----False
avoidCollisions
enum
boolean
----False
onCloseAutoFocusEvent handler called when auto-focusing on close. Can be prevented.
(event: Event) => void
----False
loopWhether keyboard navigation should loop around @defaultValue false
enum
boolean
----False
onEscapeKeyDown
(event: KeyboardEvent) => void
----False
onPointerDownOutside
(event: PointerDownOutsideEvent) => void
----False
onFocusOutside
(event: FocusOutsideEvent) => void
----False
onInteractOutside
(event: PointerDownOutsideEvent | FocusOutsideEvent) => void
----False
forceMountUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
true
----False
density
enum
loose | default | compact
----False
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuContent

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
density
enum
DensityProp
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
asChild
enum
boolean
----False
side
enum
bottom | left | right | top
----False
sideOffset
number
----False
align
enum
center | end | start
----False
alignOffset
number
----False
arrowPadding
number
----False
collisionBoundary
enum
Element | Element[]
----False
collisionPadding
enum
number | Partial<Record<bottom | left | right | top, number>>
----False
sticky
enum
always | partial
----False
hideWhenDetached
enum
boolean
----False
avoidCollisions
enum
boolean
----False
onCloseAutoFocusEvent handler called when auto-focusing on close. Can be prevented.
(event: Event) => void
----False
loopWhether keyboard navigation should loop around @defaultValue false
enum
boolean
----False
onEscapeKeyDown
(event: KeyboardEvent) => void
----False
onPointerDownOutside
(event: PointerDownOutsideEvent) => void
----False
onFocusOutside
(event: FocusOutsideEvent) => void
----False
onInteractOutside
(event: PointerDownOutsideEvent | FocusOutsideEvent) => void
----False
forceMountUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
true
----False

StyledGroup

PropDescriptionTypeDefaultRequired
asChild
enum
boolean
----False
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuGroup

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
asChild
enum
boolean
----False

ActionMenuItem

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
onSelect
(event: Event) => void
----False
asChild
enum
boolean
----False
disabled
enum
boolean
----False
textValue
string
----False

StyledItemIndicator

PropDescriptionTypeDefaultRequired
asChild
enum
boolean
----False
forceMountUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
true
----False
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuItemIndicator

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
asChild
enum
boolean
----False
forceMountUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
true
----False

StyledLabel

PropDescriptionTypeDefaultRequired
asChild
enum
boolean
----False
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuLabel

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
asChild
enum
boolean
----False

ActionMenuPortal

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
forceMountUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
true
----False
container
HTMLElement
----False

StyledRadioGroup

PropDescriptionTypeDefaultRequired
asChild
enum
boolean
----False
value
string
----False
onValueChange
(value: string) => void
----False
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuRadioGroup

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
asChild
enum
boolean
----False
value
string
----False
onValueChange
(value: string) => void
----False

StyledRadioItem

PropDescriptionTypeDefaultRequired
onSelect
(event: Event) => void
----False
asChild
enum
boolean
----False
disabled
enum
boolean
----False
textValue
string
----False
value
string
----
True
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuRadioItem

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
onSelect
(event: Event) => void
----False
asChild
enum
boolean
----False
disabled
enum
boolean
----False
textValue
string
----False
value
string
----
True

StyledSeparator

PropDescriptionTypeDefaultRequired
asChild
enum
boolean
----False
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuSeparator

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
asChild
enum
boolean
----False

StyledSub

PropDescriptionTypeDefaultRequired
open
enum
boolean
----False
defaultOpen
enum
boolean
----False
onOpenChange
(open: boolean) => void
() => False
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuSub

PropDescriptionTypeDefaultRequired
onOpenChange
Function & ((open: boolean) => void)
() => False
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
open
enum
boolean
----False
defaultOpen
enum
boolean
----False

ActionMenuSubContent

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
shadowSize
enum
ShadowProp
----False
asChild
enum
boolean
----False
sideOffset
number
----False
alignOffset
number
----False
arrowPadding
number
----False
collisionBoundary
enum
Element | Element[]
----False
collisionPadding
enum
number | Partial<Record<bottom | left | right | top, number>>
----False
sticky
enum
always | partial
----False
hideWhenDetached
enum
boolean
----False
avoidCollisions
enum
boolean
----False
loopWhether keyboard navigation should loop around @defaultValue false
enum
boolean
----False
onEscapeKeyDown
(event: KeyboardEvent) => void
----False
onPointerDownOutside
(event: PointerDownOutsideEvent) => void
----False
onFocusOutside
(event: FocusOutsideEvent) => void
----False
onInteractOutside
(event: PointerDownOutsideEvent | FocusOutsideEvent) => void
----False
forceMountUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
true
----False

ActionMenuSubTrigger

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
onClick
Function & MouseEventHandler<HTMLDivElement>
----False
asChild
enum
boolean
----False
disabled
enum
boolean
----False
textValue
string
----False

StyledTrigger

PropDescriptionTypeDefaultRequired
asChild
enum
boolean
----False
asWPDS provides an as prop for changing which tag a component outputs.
never
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
CSS<{ sm: `(max-width: calc(${string}))`; md: `(min-width: ${string}) and (max-width: calc(${string}))`; lg: `(min-width: ${string}) and (max-width: calc(${string}))`; xl: `(min-width: ${string}) and (max-width: calc(${string}))`; xxl: `(min-width: ${string}) and (max-width: ${string})`; notSm: `(min-width: calc(${s...
----False

ActionMenuTrigger

PropDescriptionTypeDefaultRequired
childrenAny React node may be used as a child to allow for formatting
enum
ReactNode
----False
cssWPDS provides a css prop for overriding styles easily. It’s like the style attribute, but it supports tokens, media queries, nesting and token-aware values. All WPDS Components include a css prop. Use it to pass in overrides.
WPDS.CSS
----False
asChild
enum
boolean
----False