Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

InlineSpacer

InlineSpacer is used to create empty inline space, typically when variable spacing is needed between multiple elements.

Note that you should favor InlineStack when spacing between all elements is the same.

Support
Targets (50)

Supported targets


InlineSpacer is used to create empty inline space, typically when variable spacing is needed between multiple elements.

Note that you should favor InlineStack when spacing between all elements is the same.

string

A unique identifier for the component.

Anchor to spacing
spacing
<Exclude<, 'none'>>
Default: 'base'

Adjust size of the spacer


Basic InlineSpacer

Example

Basic InlineSpacer

import {
reactExtension,
InlineSpacer,
InlineStack,
View,
} from '@shopify/ui-extensions-react/checkout';

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

function Extension() {
return (
<InlineStack spacing="none">
<View border="base" padding="base">
View
</View>
<InlineSpacer spacing="loose" />
<View border="base" padding="base">
View
</View>
<InlineSpacer spacing="tight" />
<View border="base" padding="base">
View
</View>
<InlineSpacer spacing="base" />
<View border="base" padding="base">
View
</View>
</InlineStack>
);
}
import {
extension,
InlineSpacer,
InlineStack,
View,
} from '@shopify/ui-extensions/checkout';

export default extension('purchase.checkout.block.render', (root) => {
const inlineSpacer = root.createComponent(InlineStack, {spacing: 'none'}, [
root.createComponent(View, {border: 'base', padding: 'base'}, 'View'),
root.createComponent(InlineSpacer, {spacing: 'loose'}),
root.createComponent(View, {border: 'base', padding: 'base'}, 'View'),
root.createComponent(InlineSpacer, {spacing: 'tight'}),
root.createComponent(View, {border: 'base', padding: 'base'}, 'View'),
root.createComponent(InlineSpacer, {spacing: 'base'}),
root.createComponent(View, {border: 'base', padding: 'base'}, 'View'),
]);

root.appendChild(inlineSpacer);
});

Was this page helpful?