Skip to main content

Migrate to the Polaris grid item component

The Polaris grid item component controls how a child spans columns and rows within a grid layout. It replaces the previous GridItem component and is available as <s-grid-item> in API versions 2025-10 and newer.


The following properties are different in the Polaris grid item component.

The previous GridItem columnSpan prop is now called gridColumn. The value format changes from a number to a CSS grid span string.

Previous patternNew patternMigration notes
columnSpan={2}gridColumn="span 2"Number values must be specified as "span N" strings.
Not specifiedgridColumn="auto"Default behavior is "auto" in both versions.

Migrating columnSpan to gridColumn

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

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

function Extension() {
return (
<s-grid gridTemplateColumns="1fr 1fr 1fr">
<s-grid-item gridColumn="span 2">
<s-text>Spans 2 columns</s-text>
</s-grid-item>
<s-text>Regular item</s-text>
</s-grid>
);
}
import {
reactExtension,
Grid,
GridItem,
Text,
} from '@shopify/ui-extensions-react/checkout';

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

function Extension() {
return (
<Grid columns={['fill', 'fill', 'fill']}>
<GridItem columnSpan={2}>
<Text>Spans 2 columns</Text>
</GridItem>
<Text>Regular item</Text>
</Grid>
);
}

The previous GridItem rowSpan prop is now called gridRow. The value format changes from a number to a CSS grid span string.

Previous patternNew patternMigration notes
rowSpan={3}gridRow="span 3"Number values must be specified as "span N" strings.
Not specifiedgridRow="auto"Default behavior is "auto" in both versions.

Migrating rowSpan to gridRow

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

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

function Extension() {
return (
<s-grid gridTemplateColumns="1fr 1fr" gridTemplateRows="auto auto auto">
<s-grid-item gridRow="span 2">
<s-text>Spans 2 rows</s-text>
</s-grid-item>
<s-text>Row 1</s-text>
<s-text>Row 2</s-text>
</s-grid>
);
}
import {
reactExtension,
Grid,
GridItem,
Text,
} from '@shopify/ui-extensions-react/checkout';

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

function Extension() {
return (
<Grid columns={['fill', 'fill']} rows={['auto', 'auto', 'auto']}>
<GridItem rowSpan={2}>
<Text>Spans 2 rows</Text>
</GridItem>
<Text>Row 1</Text>
<Text>Row 2</Text>
</Grid>
);
}
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 grid item component introduces the following new properties:

New propTypeDescription
accessibilityLabelstringLabel for assistive technologies.
accessibilityVisibility'visible' | 'hidden' | 'exclusive'Controls visibility for assistive technologies.

Was this page helpful?