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.

InlineLayout

The InlineLayout component arranges content over multiple columns with explicit control over column sizing. Use InlineLayout to create horizontal layouts where each column can have a specific width or proportion, such as a sidebar next to a main content area.

InlineLayout supports flexible column configurations, gap spacing, and alignment properties. Content doesn't wrap to new rows—extra children are added as new columns that fill the remaining inline space. For simple horizontal arrangements where elements wrap naturally, use InlineStack. For row-based vertical layouts, use BlockLayout.

Support
Targets (25)

Configure the following properties on the InlineLayout component.

Anchor to accessibilityLabel
accessibilityLabel
string

A label announced by assistive technologies that describes the purpose or contents of the element. Only set this when the element's visible content doesn't provide enough context on its own.

Anchor to accessibilityRole
accessibilityRole

The semantic meaning of the component's content. When set, assistive technologies use this role to help users navigate the page. Accepts a single role or a tuple of two roles (for example, ['listItem', 'separator']).

Anchor to background
background
<>
Default: 'transparent'

The background color of the element, set using a design-system keyword.

Anchor to blockAlignment
blockAlignment
<>

The alignment of children along the block (cross) axis.

Anchor to border
border
<<>>

The border style of the element. Accepts a single value for all four edges, or a shorthand tuple for per-edge control:

  • 'base': Applies base to all edges.
  • ['base', 'none']: Block edges get base, inline edges get none.
  • ['base', 'none', 'dotted', 'base']: Values apply to block-start, inline-end, block-end, and inline-start respectively.
Anchor to borderWidth
borderWidth
< <> >

The border width of the element. Accepts a single value for all four edges, or a shorthand tuple for per-edge control:

  • 'base': Applies base to all edges.
  • ['base', 'medium']: Block edges get base, inline edges get medium.
  • ['base', 'medium', 'medium', 'base']: Values apply to block-start, inline-end, block-end, and inline-start respectively.
Anchor to columns
columns
<>
Default: 'fill'

The sizes for each column of the layout.

  • auto: The intrinsic size of the element.
  • fill: Fills the remaining available space. When multiple elements use fill, the space is shared equally.
  • `${number}%`: A percentage of the container's inline size.
  • `${number}fr`: A fractional unit of the available space.
  • number: A fixed size in pixels.

When the sum of defined sizes exceeds the available space, elements shrink to avoid overflow. Elements without an explicit size fill the remaining space. A single value outside an array applies to all columns.

Anchor to cornerRadius
cornerRadius
< <> >

The corner radius of the element. Accepts a single value for all four corners, or a shorthand tuple for per-corner control using logical (writing-mode-aware) corners:

  • 'base': All four corners get base radius.
  • ['base', 'none']: StartStart/EndEnd get base, StartEnd/EndStart get none. In left-to-right mode, StartStart and EndEnd are the top-left and bottom-right corners.
  • ['base', 'none', 'small', 'base']: Values apply to StartStart, StartEnd, EndEnd, and EndStart respectively.

A borderRadius alias is available. When both are set, cornerRadius takes precedence.

Anchor to display
display
<'auto' | 'none'>
Default: 'auto'

The display mode of the component. Learn more about display.

  • auto: The initial value; the actual behavior depends on the component and context.
  • none: Hides the component and removes it from the accessibility tree.
string

A unique identifier for the component. Use this to target the component in scripts or stylesheets, or to distinguish it from other instances of the same component.

Anchor to inlineAlignment
inlineAlignment
<>

The alignment of children along the inline (main) axis.

Anchor to maxBlockSize
maxBlockSize
< number | `${number}%` | 'fill' >

The maximum block size (maximum height in horizontal writing modes). The element won't grow taller than this value even if its content is longer.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's block size.
  • 'fill': Takes all the available space.

Learn more about the max-block-size property.

Anchor to maxInlineSize
maxInlineSize
< number | `${number}%` | 'fill' >

The maximum inline size (maximum width in horizontal writing modes). The element won't grow wider than this value.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's inline size.
  • 'fill': Takes all the available space.

Learn more about the max-inline-size property.

Anchor to minBlockSize
minBlockSize
< number | `${number}%` | 'fill' >

The minimum block size (minimum height in horizontal writing modes). The element won't shrink smaller than this value even if its content is shorter.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's block size.
  • 'fill': Takes all the available space.

Learn more about the min-block-size property.

Anchor to minInlineSize
minInlineSize
< number | `${number}%` | 'fill' >

The minimum inline size (minimum width in horizontal writing modes). The element won't shrink narrower than this value.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's inline size.
  • 'fill': Takes all the available space.

Learn more about the min-inline-size property.

Anchor to overflow
overflow
'hidden' | 'visible'
Default: 'visible'

The overflow behavior of the element.

  • visible: Content that extends beyond the container is visible.
  • hidden: Content that extends beyond the container is clipped and not scrollable.
Anchor to padding
padding
<<>>

The padding on all edges of the element, using a shorthand syntax. You can specify one, two, or four values following the CSS shorthand convention.

  • T: A single value applied uniformly to all edges.
  • [T, T]: The first value applies to block-start and block-end, the second to inline-start and inline-end.
  • [T, T, T, T]: Values apply to block-start, inline-end, block-end, and inline-start respectively.
Anchor to spacing
spacing
< | [, ]>
Default: 'none'

The spacing between child elements. A single value applies to both the row and column axes. A pair of values (for example, ['base', 'none']) sets the row and column spacing independently.

Anchor to borderRadius
borderRadius
< <> >

The corner radius of the element. Accepts a single value for all four corners, or a shorthand tuple for per-corner control:

  • 'base': All four corners get base radius.
  • ['base', 'none']: StartStart/EndEnd get base, StartEnd/EndStart get none.
  • ['base', 'none', 'small', 'base']: Values apply to StartStart, StartEnd, EndEnd, and EndStart respectively.
Deprecated

Use cornerRadius instead.


Anchor to Create a multi-column layoutCreate a multi-column layout

Use InlineLayout to arrange content in multiple columns. This example shows the default behavior where columns share available space equally.

Create a multi-column layout

An InlineLayout arranging content in multiple columns.

Create a multi-column layout

import {
reactExtension,
InlineLayout,
View,
} from '@shopify/ui-extensions-react/customer-account';

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

function Extension() {
return (
<InlineLayout columns={['20%', 'fill']}>
<View border="base" padding="base">
20%
</View>
<View border="base" padding="base">
fill
</View>
</InlineLayout>
);
}
import {extension, InlineLayout, View} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
const inlineLayout = root.createComponent(
InlineLayout,
{
columns: ['20%', 'fill'],
},
[
root.createComponent(View, {border: 'base', padding: 'base'}, '20%'),
root.createComponent(View, {border: 'base', padding: 'base'}, 'fill'),
],
);

root.appendChild(inlineLayout);
});

Anchor to Combine with disclosure for progressive contentCombine with disclosure for progressive content

Use Disclosure with inline and block layout components to simplify the interface and reveal content only when the customer requests it.

Combine with disclosure for progressive content

A disclosure component revealing additional content in a multi-column layout.

Combine with disclosure for progressive content

import {
reactExtension,
View,
Image,
Icon,
Pressable,
Disclosure,
InlineLayout,
BlockStack,
Text,
Form,
TextField,
Button,
Divider,
InlineStack,
} from '@shopify/ui-extensions-react/checkout';

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

export const DisclosureAndAlignment = () => {
const openIds = ['one'];
return (
<View
maxInlineSize={400}
cornerRadius="large"
border="base"
>
<BlockStack spacing="none">
<Disclosure
defaultOpen="one"
onToggle={(open) =>
console.log('onToggle event', open)
}
>
<Pressable toggles="one" padding="base">
<InlineLayout
blockAlignment="center"
spacing="base"
columns={['auto', 'fill', 'auto']}
>
<Icon
source="gift"
appearance="subdued"
/>
Gift message
<Icon
source={
openIds.includes('one')
? 'chevronUp'
: 'chevronDown'
}
appearance="subdued"
/>
</InlineLayout>
</Pressable>
<View
id="one"
padding={[
'none',
'base',
'base',
'base',
]}
>
<Form
onSubmit={() =>
console.log('onSubmit event')
}
>
<BlockStack>
<InlineLayout
columns={['fill', 'fill']}
spacing="base"
>
<TextField
label="From"
name="from0"
id="from0"
/>
<TextField
label="To"
name="to0"
id="to0"
/>
</InlineLayout>
<TextField
label="Message"
name="message0"
id="message0"
/>
<View>
<Button
accessibilityRole="submit"
kind="secondary"
>
Save
</Button>
</View>
</BlockStack>
</Form>
</View>
</Disclosure>
<Divider />
<InlineLayout
blockAlignment="baseline"
spacing="base"
columns={['auto', 'fill', 'auto']}
padding="base"
>
<Icon
source="profile"
appearance="subdued"
/>
<BlockStack spacing="none">
<InlineStack blockAlignment="center">
<Text>Verify with</Text>
<Image source="https://via.placeholder.com/50x15" />
</InlineStack>
<Text
appearance="subdued"
size="small"
>
15% savings for students and
military
</Text>
</BlockStack>
<Pressable to="https://www.shopify.com">
<Icon
source="external"
appearance="subdued"
/>
</Pressable>
</InlineLayout>
</BlockStack>
</View>
);
};
import {
extension,
BlockStack,
View,
InlineLayout,
InlineStack,
Image,
Pressable,
Icon,
Text,
TextField,
Form,
Button,
Disclosure,
Divider,
} from '@shopify/ui-extensions/checkout';

export default extension(
'purchase.checkout.block.render',
(root) => {
const openIds = ['one'];

const pressable = root.createComponent(
Pressable,
{
toggles: 'one',
padding: 'base',
},
[
root.createComponent(
InlineLayout,
{
blockAlignment: 'center',
spacing: 'base',
columns: ['auto', 'fill', 'auto'],
},

  • Define explicit column sizes: Set the columns prop with specific sizes like ["fill", "auto"] for predictable layouts. Default equal distribution works for balanced content.
  • Use InlineLayout for fixed column structures: InlineLayout is best when you know exactly how many columns you need. For wrapping horizontal lists, use InlineStack.
  • Combine with StyleHelper for responsiveness: Use StyleHelper to adjust column definitions at different viewport breakpoints.

  • Content doesn't wrap to new rows. If you add more children than defined columns, they're squeezed into additional columns.
  • InlineLayout doesn't support row-based control. For row management, use BlockLayout or Grid.
  • Column sizes are defined as a flat array. You can't assign sizes to specific columns by name.

Was this page helpful?