Skip to content
Kimenpre-v1documentation home
Color scheme

ki-grid

Use a grid for independent items that reflow when their available inline size changes. Use min-column for automatic tracks or columns for a fixed count. Below 30rem of available inline size, a fixed grid switches to one column. A direct child with data-span="2" spans two tracks when they fit.

Theme for this example
Color scheme for this example
Overview Orders Customers
<ki-grid min-column="8rem">
<ki-card data-span="2">Overview</ki-card>
<ki-card>Orders</ki-card>
<ki-card>Customers</ki-card>
</ki-grid>

The grid preserves the reading and focus order of its children. Use a table when row and column relationships convey meaning.

API reference

When to use: lay out items on responsive tracks with consistent token spacing.

When not to use: for page shells, painted grouping (use ki-card), or a data grid.

Properties & attributes

AttributePropertyTypeDefaultDescription
columnscolumnsnumber | undefined–Positive whole track count. Below 30rem of available inline size the fixed grid uses one column. Omit columns for automatic tracks.
gapgap"10xl" | "11xl" | "12xl" | "13xl" | "14xl" | "15xl" | "16xl" | "17xl" | "18xl" | "19xl" | "20xl" | "21xl" | "22xl" | "23xl" | "24xl" | "25xl" | "26xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | "lg" | "md" | "sm" | "xl" | "xs" | "xxs" | "zero"'xl'Kimen spacing step, xl by default. Unsupported values keep the default gap.
min-columnminColumnstring'15rem'Minimum automatic track size as a CSS length. Defaults to 15rem and is ignored with fixed columns.

Slots

SlotDescription
(default)The content in reading order. A direct child with data-span="2" spans two tracks when they fit.

CSS parts

PartDescription
gridThe grid layout containing the slotted content.

CSS custom properties

The public styling contract of ki-grid: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-grid-gapDefault gap between grid tracks.
--ki-grid-minDefault minimum size of an automatic grid track.
--ki-layout-grid-fixed-breakpointMinimum available inline size for a fixed grid to use multiple tracks.
--ki-layout-grid-minDefault minimum inline size of an automatic grid track.
--ki-layout-spacing-xlThe xl spacing step for a stack or grid gap.
--ki-typography-family-bodysemantic font family for typography family body.

Workshop

Open ki-grid in Storybook