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.
import {
render,
InlineSpacer,
InlineStack,
View,
} from '@shopify/checkout-ui-extensions-react';
render('Checkout::Dynamic::Render', () => );
function Extension() {
return (
View
View
View
View
);
}
import {
extend,
InlineSpacer,
InlineStack,
View,
} from '@shopify/checkout-ui-extensions';
extend('Checkout::Dynamic::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);
});
Adjust size of the spacer
A unique identifier for the component.
A type that represents a value that can be a conditional style. The conditions are based on the viewport size. We highly recommend using the `Style` helper which simplifies the creation of conditional styles. To learn more check out the [conditional styles](/api/checkout-ui-extensions/components/utilities/stylehelper) documentation.
T | ConditionalStyle<T, ViewportSizeCondition>
The default value applied when none of the conditional values specified in `conditionals` are met.
An array of conditional values.
The conditions that must be met for the value to be applied. At least one condition must be specified.
The value that will be applied if the conditions are met.
'small' | 'medium' | 'large'
'none' | 'base' | 'extraTight' | 'tight' | 'loose' | 'extraLoose'