Skip to main content

Migrate SkeletonPage from Polaris React

SkeletonPage has no direct Polaris web component equivalent. Keep it during an incremental migration. If removing Polaris React is required, render the real s-page shell with a stable heading and show loading feedback only in the content regions that are pending.


Anchor to Map page loading behaviorMap page loading behavior

Polaris React usagePolaris web componentsMigration notes
Skeleton page titles-page headingUse the route title when it is already known.
Skeleton page bodys-section with a labelled s-spinnerKeep the page structure stable and replace the region when data arrives.
Entire route navigationLoading APICoordinate host loading feedback with the router and clear it on success or failure.
Skeleton actionsHide unavailable actions or render real disabled actions with an explanationDon't display controls that look actionable but have no outcome.

Migrate the route's loading, error, empty, and loaded states together. A page that removes the skeleton but has no failure state isn't complete.


Migrating SkeletonPage

export function SkeletonPageMigrationExample() {
return (
<><s-page heading="Products"><s-section><s-spinner accessibilityLabel="Loading products"></s-spinner></s-section></s-page></>
);
}
import {SkeletonPage, Card, SkeletonBodyText} from '@shopify/polaris';


export function SkeletonPageMigrationExample() {

return (
<SkeletonPage title="Products"><Card><SkeletonBodyText /></Card></SkeletonPage>
);
}

Preview


Anchor to Test and remove Polaris ReactTest and remove Polaris React

  • Load the route directly and through app navigation.
  • Test fast, slow, failed, retried, and cancelled requests.
  • Verify the page heading, title-bar actions, focus, and loading indicator don't become stale after navigation.

Was this page helpful?