Grid

The Grid component creates a responsive auto-fit grid whose columns adapt to the available width.

Usage & Examples

Responsive Content Grid

AnalyticsWeekly performance
CustomersRecent activity
OrdersOpen fulfilment
responsive-content-grid.tsx
const tileStyle = {
  boxSizing: "border-box",
  display: "flex",
  flexDirection: "column",
  justifyContent: "center",
  width: "100%",
  height: "100%",
  minHeight: "4.5rem",
  padding: "1rem",
  border: "1px solid var(--border-color)",
  borderRadius: "var(--border-radius-md, 0.75rem)",
  background: "var(--background-color-surface)",
};

<Grid minColumnWidth="9rem" gap="md">
  <div style={tileStyle}><strong>Analytics</strong><span>Weekly performance</span></div>
  <div style={tileStyle}><strong>Customers</strong><span>Recent activity</span></div>
  <div style={tileStyle}><strong>Orders</strong><span>Open fulfilment</span></div>
</Grid>

Props API

9 props
Columns
Grid props API
Default
Description
alignLayoutAlignNoprops—Align prop for LayoutPrimitive.
asElementTypeNoprops—As prop for LayoutPrimitive.
childrenReactNodeNoprops—Content rendered inside the component.
classNamestringNostyling—Additional CSS class names for the component root.
data-testidstringNotesting—Test id used to identify the component in tests.
gapLayoutGapNoprops"md"Gap.
justifyLayoutJustifyNoprops—Justify prop for LayoutPrimitive.
minColumnWidthstringNoprops"16rem"Min Column Width.
testIdstringNoprops—Test id used to identify the component in tests.