Skip to main content

Migrate ActionMenu from Polaris React

Polaris React ActionMenu combines visible page-level secondary actions, grouped menus, and responsive rollup behavior. In Polaris web components, place important page actions in s-page action slots and use s-menu for grouped or overflow actions.

Don't move every action into a menu. Keep frequent and important actions visible, and reserve menus for secondary contextual actions.

Migrating ActionMenu

export function ProductPageActions({
onExport,
onDuplicate,
onArchive,
onDelete,
}) {
return (
<s-page heading="Product">
<s-button slot="secondary-actions" icon="export" onClick={onExport}>
Export
</s-button>
<s-button slot="secondary-actions" commandFor="product-actions">
More actions
</s-button>
<s-menu id="product-actions" accessibilityLabel="Product actions">
<s-button icon="duplicate" onClick={onDuplicate}>
Duplicate
</s-button>
<s-button icon="archive" onClick={onArchive}>
Archive
</s-button>
<s-button icon="delete" tone="critical" onClick={onDelete}>
Delete
</s-button>
</s-menu>
<s-section>
<s-text>Product details</s-text>
</s-section>
</s-page>
);
}
import {Card, Page, Text} from '@shopify/polaris';
import {
ArchiveIcon,
DeleteIcon,
DuplicateIcon,
ExportIcon,
} from '@shopify/polaris-icons';

export function ProductPageActions({
onExport,
onDuplicate,
onArchive,
onDelete,
}) {
return (
<Page
title="Product"
secondaryActions={[
{
content: 'Export',
icon: ExportIcon,
onAction: onExport,
},
]}
actionGroups={[
{
title: 'More actions',
actions: [
{
content: 'Duplicate',
icon: DuplicateIcon,
onAction: onDuplicate,
},
{
content: 'Archive',
icon: ArchiveIcon,
onAction: onArchive,
},
{
content: 'Delete',
icon: DeleteIcon,
destructive: true,
onAction: onDelete,
},
],
},
]}
>
<Card>
<Text as="p">Product details</Text>
</Card>
</Page>
);
}

Preview


Replace the actions descriptor array with explicit s-button or s-link elements. Put actions that define the page in the appropriate s-page action slot. Put less frequent actions inside a sibling s-menu.

Polaris React behaviorPolaris web components
Visible secondary actions-button slot="secondary-actions"
Navigation actions-link with href, in a supported page slot or visible composition
Overflow actions-button child of s-menu
Action icon componentA documented icon name string in icon
onActiononClick

For the complete action-descriptor mapping, see Migrate ActionList.

Each group becomes a labelled trigger s-button and a sibling s-menu. The trigger's commandFor references the menu's id. Render menu actions as buttons, and use s-section only when headings help merchants scan a larger menu.

Polaris React group fieldPolaris web components
titleTrigger button text, or s-section heading when the title labels items inside a shared menu
actionss-button children of s-menu
iconicon on the trigger button
disableddisabled on the trigger, or on individual items when only some actions are unavailable
indexRender the trigger or section in the intended order
onActionAnyItemCall the shared callback from each item's onClick handler
onClick(openActions)Put required side effects on the trigger's onClick and let commandFor open the menu
detailsNo menu equivalent; move essential details into visible page content
badgeNo menu-trigger badge; keep essential state visible outside the menu or in a self-contained label

Remove rollup. Decide explicitly which actions remain visible and which belong in a menu. Don't preserve width-measurement behavior through a compatibility wrapper.

Review the result at narrow widths. If the page contains too many actions, reduce or regroup them instead of hiding primary actions.

Use a visible, self-contained trigger label such as More actions. Set accessibilityLabel on s-menu to describe the menu's scope, such as Product actions.

There is no rollup-state callback. Remove app behavior that depends only on whether Polaris React happened to overflow an action. If responsive state changes actual business behavior, model that requirement independently from the action presentation.


Anchor to New responsibilitiesNew responsibilities

The migrated page owns the action hierarchy:

  • Which action is primary, visible secondary, or placed in a menu.
  • Which grouped actions need a heading.
  • Confirmation and result feedback for consequential actions.
  • Action availability based on current resource state.

Don't duplicate the same action in a visible slot and a menu at the same viewport size.


  • Test every visible and menu action, including navigation and destructive results.
  • Verify menu triggers and items with keyboard and screen-reader navigation.
  • Confirm focus returns to the trigger when the menu closes.
  • Test narrow widths, zoom, and translated labels.
  • Verify important actions remain visible and the menu stays scannable.
  • Remove ActionMenu and unused Polaris React icon imports after the final call site is migrated.


Was this page helpful?