Skip to main content
In progress

ActionMenu

ActionMenu is a button that opens a dropdown list of actions. It groups multiple related actions into a compact control without changing the component’s state when an item is selected.

Code example
import { ActionMenu, MenuItem, MenuSeparator } from '@yleisradio/yds-components-react';

<ActionMenu text="Actions" id="action-menu-1" menuId="menu-1">
<MenuItem onSelect={() => {}}>Option 1</MenuItem>
<MenuItem onSelect={() => {}}>Option 2</MenuItem>
<MenuSeparator />
<MenuItem onSelect={() => {}}>Option 3</MenuItem>
</ActionMenu>

Why to use

ActionMenu provides a clear and space-efficient way to expose multiple related actions from a single entry point. Instead of showing several buttons side by side, ActionMenu keeps the interface uncluttered while still making all actions easily accessible.

It is built on top of Menu, ensuring consistent positioning, keyboard navigation, and accessibility across products while supporting typical action-based use cases such as sharing, editing, or managing content.

When to use

Use ActionMenu when the user needs to trigger one of several related actions that do not affect the component’s state.

Do
  • Use when multiple related actions are available from the same context.
  • Use for secondary or contextual actions such as sharing, editing, or managing content.
  • Use when space is limited and showing all actions at once would clutter the UI.
Don't
  • Don’t use for selecting values or changing component state (use DropdownMenu instead).
  • Don’t use for navigation between views or pages.
  • Don’t use for a single action (use a Button instead).

Content Guidelines

ActionMenu items represent actions, not values.

Do
  • Use verbs for menu items (e.g. “Jaa”, “Muokkaa”, “Poista”).
  • Keep labels concise and action-oriented.
  • Group related actions using separators when necessary.
Don't
  • Don’t use nouns or descriptive values as menu items.
  • Don’t use vague labels like “OK” or “Kyllä”.
  • Don’t mix actions with selection-type options in the same menu.

Anatomy

ActionMenu anatomy

  1. ActionMenu button – The trigger that opens the list of actions.
  2. Label – Text describing the category of actions (e.g. “Actions”, “Share”).
  3. Chevron icon – Indicates that the button opens a dropdown.
  4. Menu surface – The floating container holding the action items.
  5. MenuItem (action) – A single actionable option inside the menu.
  6. MenuItem icon (optional) – An optional leading icon inside a MenuItem
  7. MenuSeparator (optional) – Groups related actions.

Key ActionMenu Props

Use these props to configure the ActionMenu component.

text

The text displayed on the action menu button.

TypeExampleDescription
stringButton label text
Code example
<ActionMenu text="Actions" id="menu-1" menuId="menu-1">
<MenuItem onSelect={() => {}}>Option</MenuItem>
</ActionMenu>

children

Menu items to display in the dropdown menu.

TypeExampleDescription
React.ReactNodeMenuItem components to display
Code example
<ActionMenu text="Actions" id="menu-1" menuId="menu-1">
<MenuItem onSelect={() => {}}>Option 1</MenuItem>
<MenuItem onSelect={() => {}}>Option 2</MenuItem>
</ActionMenu>

Whether to show a dropdown chevron icon.

ValueExampleDescription
trueShows the chevron icon
falseHides the chevron icon
Code example
<ActionMenu dropdown={true} text="Actions" id="menu-1" menuId="menu-1">
<MenuItem onSelect={() => {}}>Option</MenuItem>
</ActionMenu>
<ActionMenu dropdown={false} text="Actions" id="menu-2" menuId="menu-2">
<MenuItem onSelect={() => {}}>Option</MenuItem>
</ActionMenu>

openMenuOnClick

Whether clicking the button opens the menu.

TypeExampleDescription
booleanControls if click opens the menu
Code example
<ActionMenu openMenuOnClick={true} text="Actions" id="menu-1" menuId="menu-1">
<MenuItem onSelect={() => {}}>Option</MenuItem>
</ActionMenu>

Size of the menu items.

ValueExampleDescription
smSmall menu items
mdDefault medium menu items
Code example
<ActionMenu menuSize="sm" text="Actions" id="menu-1" menuId="menu-1">
<MenuItem onSelect={() => {}}>Option</MenuItem>
</ActionMenu>
<ActionMenu menuSize="md" text="Actions" id="menu-2" menuId="menu-2">
<MenuItem onSelect={() => {}}>Option</MenuItem>
</ActionMenu>

alignMenu

Horizontal alignment of the menu relative to the button.

ValueExampleDescription
leftAligns menu to the left
rightAligns menu to the right (default)
Code example
<ActionMenu alignMenu="left" text="Actions" id="menu-1" menuId="menu-1">
<MenuItem onSelect={() => {}}>Option</MenuItem>
</ActionMenu>
<ActionMenu alignMenu="right" text="Actions" id="menu-2" menuId="menu-2">
<MenuItem onSelect={() => {}}>Option</MenuItem>
</ActionMenu>

Behavior

  • Selecting an item triggers the associated action immediately.
  • The ActionMenu label does not change based on selection.
  • The menu opens from the trigger and closes after selection, outside click, or cancellation.
  • The menu is positioned relative to the button and adapts to the viewport.
  • Keyboard interaction:
    • Arrow keys navigate between actions.
    • Enter activates the focused action.
    • Escape closes the menu.

Accessibility

  • Ensure full keyboard support for all interactions.
    (WCAG 2.1.1 — Keyboard)
  • Menu items have clear visual focus indicators.
    (WCAG 2.4.7 — Focus Visible)
  • Each menu item exposes a clear, descriptive action name to assistive technologies.
    (WCAG 4.1.2 — Name, Role, Value)
  • The menu state (open/closed) is communicated programmatically.
  • Actions are perceivable and understandable without relying on icons alone.

Implementation Examples

Share menu

Share menu using ShareButton package that uses ActionMenu under the hood.

Code example
import { ShareButton } from '@yleisradio/share-button';

<ShareButton
shareData={{
url: 'https://design-system.test.yle.fi/docs/components/ActionMenu',
title: 'Action Menu Documentation',
body: 'A detailed guide on using the ActionMenu component in Yle Design System.',
}}
lang="fi"
onOpen={() => console.log('Share menu opened!')}
/>

API Reference

Props

The ActionMenu component accepts all standard Button props (except as and onClick) in addition to the following props:

PropTypeRequiredDefaultDescription
textstringYesButton label text
idstringYesUnique identifier for the button
menuIdstringYesUnique identifier for the menu
childrenReact.ReactNodeYesMenuItem components to display
dropdownbooleanNotrueWhether to show dropdown chevron icon
openMenuOnClickbooleanNotrueWhether clicking opens the menu
onClose() => voidNoCallback fired when menu closes
onOpen() => voidNoCallback fired when menu opens
menuSize'sm' | 'md'No'md'Size of menu items
alignMenu'left' | 'right'No'right'Horizontal alignment of menu

Type Definitions

export interface ActionMenuDSProps {
text: string;
id: string;
menuId: string;
children: ReactNode;
dropdown?: boolean;
openMenuOnClick?: boolean;
onClose?: () => void;
onOpen?: () => void;
menuSize?: 'md' | 'sm';
alignMenu?: 'left' | 'right';
}

export type ActionMenuProps = ActionMenuDSProps & Omit<ButtonProps<'button'>, 'as' | 'onClick'>;
  • DropdownMenu – Alternative component for selectable menu options
  • Button – ActionMenu extends Button functionality
  • Menu - Base component for ActionMenu