Migrate Thumbnail from Polaris React
Use s-thumbnail for a compact resource preview and preserve meaningful alternative text. Use s-image when the image is primary content rather than a thumbnail.
Anchor to Choose the destinationChoose the destination
| Polaris React | Polaris web components | Migration type |
|---|---|---|
Thumbnail | s-thumbnail | Direct |
Anchor to Map thumbnail propertiesMap thumbnail properties
| Polaris React | Polaris web components | Migration notes |
|---|---|---|
source | src | Preserve the resource image URL and fallback behavior. |
alt | alt | Name the represented resource, or use an empty value for a decorative duplicate. |
size="extraSmall" | No exact equivalent; start with size="small-200" | Verify density in the containing table or list. |
size="small" | size="small" | Keep the compact size when it still fits the destination layout. |
size="medium" | size="base" | The default size was renamed. Don't pass medium through. |
size="large" | size="large" | Keep for prominent resource previews. |
The destination also provides small-100 and large-100 intermediate values. Choose among the documented scale based on the resource hierarchy, and use one consistent size within a table, list, or grid.
Anchor to Migrate the call siteMigrate the call site
-
Inventory every
Thumbnailcall site and record the content, state, events, and accessibility behavior it uses. -
Open the linked Polaris web component reference and map only documented properties, slots, and events.
-
Move unsupported responsibilities into adjacent content or app state instead of passing old props through.
-
After verification, remove the
Thumbnailimport 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 Thumbnail 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.
Anchor to Migration exampleMigration example
Migrating Thumbnail
Polaris web components
export function ThumbnailMigrationExample() {
return (
<s-thumbnail
src="https://cdn.shopify.com/static/images/polaris/thumbnail-wc_src.jpg"
alt="White sneaker"
size="large"
/>
);
}Polaris React
import {Thumbnail} from '@shopify/polaris';
export function ThumbnailMigrationExample() {
return (
<Thumbnail
source="https://cdn.shopify.com/static/images/polaris/thumbnail-wc_src.jpg"
alt="White sneaker"
size="large"
/>
);
}