ki-grid
@kimen/elements/ki-grid- Source
- Agent reference
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.
<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
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
columns | columns | number | undefined | – | Positive whole track count. Below 30rem of available inline size the fixed grid uses one column. Omit columns for automatic tracks. |
gap | gap | "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-column | minColumn | string | '15rem' | Minimum automatic track size as a CSS length. Defaults to 15rem and is ignored with fixed columns. |
Slots
| Slot | Description |
|---|---|
| (default) | The content in reading order. A direct child with data-span="2" spans two tracks when they fit. |
CSS parts
| Part | Description |
|---|---|
grid | The 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.
| Token | Description |
|---|---|
--ki-grid-gap | Default gap between grid tracks. |
--ki-grid-min | Default minimum size of an automatic grid track. |
--ki-layout-grid-fixed-breakpoint | Minimum available inline size for a fixed grid to use multiple tracks. |
--ki-layout-grid-min | Default minimum inline size of an automatic grid track. |
--ki-layout-spacing-xl | The xl spacing step for a stack or grid gap. |
--ki-typography-family-body | semantic font family for typography family body. |