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.

InlineStack

The InlineStack component arranges elements horizontally along the inline axis with consistent spacing. Use InlineStack to lay out items in a row that automatically wraps to the next line when content exceeds the available space, such as a group of tags or action buttons.

InlineStack supports gap spacing, alignment, and wrapping properties for flexible horizontal layouts. For fixed-column layouts where content shouldn't wrap, use InlineLayout. For vertical stacking, use BlockStack.

Support
Targets (25)

Configure the following properties on the InlineStack 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
<>
Default: 'start'

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 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
<>
Default: 'start'

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: 'base'

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 Arrange items in a rowArrange items in a row

Use InlineStack to lay out elements horizontally with uniform spacing. This example arranges items in a row that automatically wraps to the next line when they exceed the container width.

Arrange items in a row

An InlineStack arranging elements in a horizontal row.

Arrange items in a row

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

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

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

export default extension('customer-account.page.render', (root) => {
const inlineStack = root.createComponent(
InlineStack,
{
spacing: 'base',
},
[
root.createComponent(View, {border: 'base', padding: 'base'}, 'View'),
root.createComponent(View, {border: 'base', padding: 'base'}, 'View'),
root.createComponent(View, {border: 'base', padding: 'base'}, 'View'),
root.createComponent(View, {border: 'base', padding: 'base'}, 'View'),
],
);

root.appendChild(inlineStack);
});

  • Use for wrapping horizontal lists: InlineStack is ideal when you want elements to flow horizontally and wrap naturally. For fixed-column layouts, use InlineLayout.
  • Keep spacing consistent: Set the spacing prop to maintain uniform gaps between elements.
  • Combine with alignment: Use blockAlignment and inlineAlignment to control how items are positioned within the stack.

  • Elements always wrap when they exceed the container width. This behavior can't be disabled.
  • InlineStack doesn't support explicit column sizing. For fixed-width columns, use InlineLayout.
  • Reverse ordering isn't supported. Items always render in document order.

Was this page helpful?