Skip to main content

Migrate PositionedOverlay from Polaris React

Choose s-popover for contextual content, s-tooltip for brief supplementary text, or s-modal for a dialog task. Let that component own positioning and focus.


Anchor to Choose the destinationChoose the destination

Polaris ReactPolaris web componentsMigration type
PositionedOverlays-popover, s-tooltip, or s-modalCompose

Anchor to Map positioned overlay responsibilitiesMap positioned overlay responsibilities

Polaris React responsibilityPolaris web componentsMigration notes
Anchored action contents-popoverConnect the trigger with commandFor and keep the popover as a sibling.
Descriptive hover or focus contents-tooltipAssociate it with interestFor and don't put actions inside it.
Placement, collision, and active stateDestination overlay plus commands or methodsRemove manual rectangles and verify Escape, dismissal, and focus restoration.

Anchor to Migrate the call siteMigrate the call site

  1. Identify each responsibility currently hidden behind PositionedOverlay: layout, semantics, state, actions, and responsive behavior.

  2. Build the documented composition for those responsibilities; don't create a compatibility wrapper that accepts the old API.

  3. Reconnect app state and verify the composition at every existing call site.

  4. After verification, remove the PositionedOverlay import and any Polaris-only state, wrappers, or helpers that no longer have a caller.


Anchor to Preserve these behaviorsPreserve these behaviors

  • Information hierarchy, reading order, and accessible relationships.
  • App-owned state and every action or navigation outcome.
  • Responsive behavior and focus order across the composed elements.

Anchor to Test and remove Polaris ReactTest and remove Polaris React

Test the complete PositionedOverlay composition at each responsive size used by the app. Verify reading and focus order, accessible relationships, keyboard interaction, and every action outcome.

Don't remove @shopify/polaris while another component still imports it. Once all call sites are migrated, remove the package and its provider-level setup, then run the app's full test suite.


Was this page helpful?