Skip to main content

Migrate Sticky from Polaris React

Use app-owned position: sticky only when the content must remain in view within its scroll container. Test overlap, zoom, small screens, and keyboard focus.


Anchor to Choose the destinationChoose the destination

Polaris ReactPolaris web componentsMigration type
StickyApp-owned CSS using position: stickyNative CSS

Anchor to Map sticky responsibilitiesMap sticky responsibilities

Polaris React usagePolaris web componentsMigration notes
Page actions or title contents-page action slotsMove important actions to the Shopify admin title bar.
Contextual save controlsdata-save-bar or Save Bar APIUse the host save bar for unsaved form state.
boundingElement and offsetsRemove with the old layoutRecheck content occlusion, focus visibility, zoom, and small containers.

Anchor to Migrate the call siteMigrate the call site

  1. Document the layout constraint that caused Sticky to be used.

  2. Apply narrowly scoped app-owned CSS to the element responsible for that behavior.

  3. Test responsive layout, zoom, overflow, and keyboard focus.

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


Anchor to Preserve these behaviorsPreserve these behaviors

  • Readable full content and visible keyboard focus.
  • Behavior at narrow widths, high zoom, and long translated content.
  • Containment so the rule doesn't change unrelated surfaces.

Anchor to Test and remove Polaris ReactTest and remove Polaris React

Test the migrated Sticky behavior at narrow widths, 200% zoom, and with long translated content. Verify full content remains available and keyboard focus remains visible.

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?