Skip to main content

Migrate Spinner from Polaris React

Use s-spinner for indeterminate progress in a bounded region. Pair it with text when the operation or wait state isn't obvious.


Anchor to Choose the destinationChoose the destination

Polaris ReactPolaris web componentsMigration type
Spinners-spinnerDirect

Anchor to Map spinner propertiesMap spinner properties

Polaris ReactPolaris web componentsMigration notes
accessibilityLabelaccessibilityLabelName the operation, such as "Loading products", not the spinner itself.
size="small"size="base"Use for inline or compact feedback.
size="large"size="large" or size="large-100"Use for a larger standalone loading state.

Anchor to Migrate the call siteMigrate the call site

  1. Inventory every Spinner call site and record the content, state, events, and accessibility behavior it uses.

  2. Open the linked Polaris web component reference and map only documented properties, slots, and events.

  3. Move unsupported responsibilities into adjacent content or app state instead of passing old props through.

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


Anchor to Preserve these behaviorsPreserve these behaviors

  • Accessible names, semantics, and keyboard behavior.
  • Visible content plus disabled, loading, selected, or error state that affects the task.
  • Click, change, submit, and navigation behavior used by app logic.

Anchor to Test and remove Polaris ReactTest and remove Polaris React

Test every migrated Spinner state used by the app. For interactive destinations, verify keyboard operation, focus, and accessible naming. For content destinations, verify document structure and alternative text where applicable. Compare behavior rather than pixel-for-pixel styling.

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.


Migrating Spinner

export function SpinnerMigrationExample() {
return (
<><s-spinner accessibilityLabel="Loading products" size="large"></s-spinner></>
);
}
import {Spinner} from '@shopify/polaris';


export function SpinnerMigrationExample() {

return (
<Spinner accessibilityLabel="Loading products" size="large" />
);
}

Preview


Was this page helpful?