Migrate Divider from Polaris React
Use s-divider only when a visible separator clarifies grouping. Prefer spacing or section boundaries when the divider is purely decorative.
Anchor to Choose the destinationChoose the destination
| Polaris React | Polaris web components | Migration type |
|---|---|---|
Divider | s-divider | Direct |
Anchor to Map divider propertiesMap divider properties
| Polaris React | Polaris web components | Migration notes |
|---|---|---|
| Default divider | s-divider | Use the default for a horizontal separator. |
borderColor | color="base" or color="strong" | Choose the emphasis from hierarchy instead of translating an old token. |
| Vertical separator | direction="block" | Use only when adjacent inline content needs a visible boundary. |
Anchor to Migrate the call siteMigrate the call site
-
Inventory every
Dividercall 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
Dividerimport 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 Divider 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 Divider
Polaris web components
export function DividerMigrationExample() {
return (
<><s-divider></s-divider></>
);
}Polaris React
import {Divider} from '@shopify/polaris';
export function DividerMigrationExample() {
return <Divider borderColor="border" />;
}