Skip to main content

Migrate InlineLayout to the Polaris grid component

The previous InlineLayout component has been replaced by the <s-grid> component. Use gridTemplateColumns to define the column tracks for your inline layout. <s-grid> is available in API versions 2025-10 and newer.


The following properties are different in the Polaris grid component.

The previous InlineLayout columns prop is now called gridTemplateColumns. The value format changes from an array to a CSS grid template string.

Previous patternNew patternMigration notes
columns={['fill', 'auto']}gridTemplateColumns="1fr auto"'fill' becomes 1fr.
columns={['fill', 'fill']}gridTemplateColumns="1fr 1fr"Array items become space-separated values.
columns={[200, 'fill']}gridTemplateColumns="200px 1fr"Number values were pixels; append px in the CSS string.

Migrating InlineLayout to grid

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

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

function Extension() {
return (
<s-grid gridTemplateColumns="1fr auto" gap="base">
<s-text>Product name</s-text>
<s-text>$9.99</s-text>
</s-grid>
);
}
import {
reactExtension,
InlineLayout,
Text,
} from '@shopify/ui-extensions-react/checkout';

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

function Extension() {
return (
<InlineLayout columns={['fill', 'auto']} spacing="base">
<Text>Product name</Text>
<Text>$9.99</Text>
</InlineLayout>
);
}
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 previous InlineLayout spacing prop is now called gap.

Previous patternNew patternMigration notes
spacing="base"gap="base"Direct rename.

The previous InlineLayout blockAlignment prop is now called alignItems.

Previous patternNew patternMigration notes
blockAlignment="center"alignItems="center"Use alignItems to align items along the block axis.

The previous InlineLayout inlineAlignment prop has been replaced with justifyItems and justifyContent.

Previous patternNew patternMigration notes
inlineAlignment="end"justifyItems="end"Use justifyItems to align items within their grid areas.
inlineAlignment="end"justifyContent="end"Use justifyContent to align grid tracks when there's extra space.

The previous InlineLayout border shorthand controlled border style (for example, border="dotted"). On <s-grid>, 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 InlineLayout borderWidth accepted 'base', 'medium', 'thick'. The Polaris grid 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 InlineLayout display values 'inline' and 'block' are no longer accepted. The Polaris grid 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-grid> are still valid for non-inline content.
'none''none'No change needed.

The previous InlineLayout 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 paddingBlock or paddingInline instead of padding.

Several accessibilityRole values have been renamed in the Polaris grid 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 grid 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.

Was this page helpful?