Horizontal grid

Use to lay out children horizontally with equal gap between columns. Based on CSS Grid.


This component is a work in progress and ready for exploratory usage, with breaking changes expected in minor version updates. Please use with caution. Learn more about our component lifecycles.

Use the gap prop to set the amount of space between columns. The gap prop supports responsive spacing with the Breakpoints tokens.

import React from 'react';
import {HorizontalGrid} from '@shopify/polaris';

function HorizontalGridWithVaryingGapExample() {
  return (
      <HorizontalGrid gap="4" columns={3}>
        <Placeholder height="320px" />
        <Placeholder height="320px" />
        <Placeholder height="320px" />

const SpacingBackground = ({
  width = '100%',
}: {
  children: React.ReactNode;
  width?: string;
}) => {
  return (
        background: 'var(--p-color-bg-success-subdued)',
        height: 'auto',

const Placeholder = ({height = 'auto', width = 'auto'}) => {
  return (
        display: 'inherit',
        background: 'var(--p-color-text-info)',
        height: height ?? undefined,
        width: width ?? undefined,


Want to help make this feature better? Please share your feedback.

interface HorizontalGridProps
columns?T | { [Breakpoint in BreakpointsAlias]?: T; }<number | string | ('oneThird' | 'oneHalf' | 'twoThirds')[]>

The number of columns to display. Accepts either a single value or an object of values for different screen sizes.

gap?T | { [Breakpoint in BreakpointsAlias]?: T; }<SpaceScale>

The spacing between children. Accepts a spacing token or an object of spacing tokens for different screen sizes.

alignItems?'start' | 'end' | 'center'

Vertical alignment of children. If not set, inline elements will stretch to the height of the parent.