Skip to main content

Migrate View to the Polaris box component

The Polaris box component is a generic container for layout and styling. It replaces the previous View component and is available as <s-box> in API versions 2025-10 and newer.


The following properties are different in the Polaris box component.

The previous View visibility prop is now called accessibilityVisibility.

Previous patternNew patternMigration notes
visibility="hidden"accessibilityVisibility="exclusive"Hides visually but remains accessible to assistive technologies.

The previous View cornerRadius prop is now called borderRadius. Some values have changed:

Previous valueNew valueMigration notes
'none''none'No change needed.
'small''small-100'Renamed to use token suffix. 'small' is accepted as an alias.
'base''base'No change needed.
'large''large-100'Renamed to use token suffix. 'large' is accepted as an alias.
'fullyRounded''max'Renamed.

For more on the scale system, see Scale.

The previous View border shorthand controlled border style (for example, border="dotted"). On <s-box>, border controls border size by default and accepts a token-based shorthand for size, color, and style:

PatternExampleDescription
'{size}'border="base"Border size only.
'{size} {color}'border="base base"Border size and color.
'{size} {color} {style}'border="base base dashed"Border size, color, and style.
Previous valueNew valueMigration notes
'base' (single solid border)border="base"Renders a default-size border.
'dotted'border="base base dotted"Specify size and color before style.
'dashed'border="base base dashed"Specify size and color before style.
'none'border="none" or omitNo border.

The previous View borderWidth accepted 'base', 'medium', 'thick'. The Polaris box borderWidth accepts a reduced keyword set: 'none', 'base', 'large', 'large-100', 'large-200'.

Previous valueNew valueMigration notes
'base''base'No change needed.
'medium''large''medium' is removed.
'thick''large-200''thick' is removed.

The previous View display values 'inline' and 'block' are no longer accepted. The Polaris box display accepts 'auto' (the default) and 'none'.

Previous valueNew valueMigration notes
'block''auto' (the default)Omit display for default block-level rendering.
'inline'RemovedWrap inline content in <s-text> instead. This advice applies only when migrating display="inline" usages — direct text children of <s-box> are still valid for non-inline content.
'none''none'No change needed.

The previous View padding prop's accepted values and multi-side shorthand format have changed.

Use the following mapping to migrate deprecated tokens:

PreviousNew
'none''none'
'extraTight''small-400'
'tight''small-200'
'base''base'
'loose''large-200'
'extraLoose''large-500'

The new token scale also adds 'small-500', 'small-300', 'small-100', 'small', 'large', 'large-100', 'large-300', and 'large-400'.

For more on the scale system, see Scale.

The multi-side shorthand format has also changed:

PreviousNew
Array of 2 or 4 values: ['base', 'none']Space-separated string with 1 to 4 values: "base none". The 3-value variant "block-start inline block-end" is also supported.

To set padding on a single side or axis, use the new logical-property props instead of padding. See New properties for the full list.

The size properties accept updated values in the Polaris box component. 'fill' has been removed across all of them — use '100%' instead.

PropertyPrevious valuesNew valuesMigration notes
inlineSize'fill'`${number}px` | `${number}%` | '0' | 'auto''fill' is removed. Use '100%' instead.
maxInlineSizenumber | `${number}%` | 'fill'`${number}px` | `${number}%` | '0' | 'none''fill' is removed. Use '100%' instead.
minInlineSizenumber | `${number}%` | 'fill'`${number}px` | `${number}%` | '0''fill' is removed. Use '100%' instead.
maxBlockSizenumber | `${number}%` | 'fill'`${number}px` | `${number}%` | '0' | 'none''fill' is removed. Use '100%' instead.
minBlockSizenumber | `${number}%` | 'fill'`${number}px` | `${number}%` | '0''fill' is removed. Use '100%' instead.

Several accessibilityRole values have been renamed in the Polaris box component. Update them to the new role names:

Previous valueNew value
'complementary''aside'
'orderedList''ordered-list'
'unorderedList''unordered-list'
'listItem''list-item'

Other previously supported roles ('main', 'header', 'footer', 'section', 'navigation', 'separator', 'status', 'alert') are accepted unchanged. The Polaris box also adds the following new roles:

New roleDescription
'list-item-separator'Separator between list items.
'generic'Generic container.
'presentation'Decorative element.
'none'No semantic role.

Migrating View to box

import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default function extension() {
render(<Extension />, document.body);
}

function Extension() {
return (
<s-box
background="subdued"
padding="base"
border="base"
borderRadius="base"
>
Card content
</s-box>
);
}
import {
reactExtension,
View,
Text,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return (
<View
background="subdued"
padding="base"
border="base"
cornerRadius="base"
>
<Text>Card content</Text>
</View>
);
}
Responsive values

If you used Style.default().when() to make this property responsive, container queries replace the Style helper. Wrap your content in <s-query-container> and use @container syntax in the property value. Learn more in Migrate StyleHelper to container queries.


The Polaris box component no longer supports position.

The Polaris box component no longer supports translate.

The Polaris box component no longer supports blockAlignment. Wrap the box in <s-stack> and use alignItems for cross-axis alignment.

Migrating blockAlignment to alignItems

import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default function extension() {
render(<Extension />, document.body);
}

function Extension() {
return (
<s-stack alignItems="center">
<s-text>Centered content</s-text>
</s-stack>
);
}
import {
reactExtension,
View,
Text,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return (
<View blockAlignment="center">
<Text>Centered content</Text>
</View>
);
}

The Polaris box component no longer supports inlineAlignment. Wrap the box in <s-stack> and use justifyContent for main-axis alignment.

Migrating alignment to stack

import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default function extension() {
render(<Extension />, document.body);
}

function Extension() {
return (
<s-stack justifyContent="end">
<s-button>Submit</s-button>
</s-stack>
);
}
import {
reactExtension,
View,
Button,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return (
<View inlineAlignment="end">
<Button>Submit</Button>
</View>
);
}

The Polaris box component no longer supports opacity. There's no workaround for this property.

The Polaris box component no longer supports borderColor as a separate property. Use the border shorthand instead. See the border section for the accepted patterns.


The Polaris box component introduces the following new properties:

New propTypeDescription
blockSize`${number}px` | `${number}%` | '0' | 'auto'Adjusts the block size of the box.
borderStyle'auto' | 'none' | 'solid' | 'dashed' | 'dotted'Sets the border style independently from the border shorthand.
paddingBlockSpacing tokenPadding on the block axis.
paddingBlockStartSpacing tokenPadding at the start of the block axis.
paddingBlockEndSpacing tokenPadding at the end of the block axis.
paddingInlineSpacing tokenPadding on the inline axis.
paddingInlineStartSpacing tokenPadding at the start of the inline axis.
paddingInlineEndSpacing tokenPadding at the end of the inline axis.

Was this page helpful?