Layout
SimpleGrid
CSS grid with a fixed number of equal columns, or as many columns as fit a minimum width.
import { SimpleGrid } from "datui";Playground
<SimpleGrid columns={3} gap="m" />Examples
Fixed columns
1
2
3
4
5
6
Responsive columns
minColWidth auto-fills columns; resize the window.
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Accessibility
- Purely presentational; DOM order is reading order.
API
SimpleGrid
CSS grid with equal columns.
| Prop | Type | Default | Description |
|---|---|---|---|
| align | "center" | "start" | "end" | "stretch" | "baseline" | — | |
| alignSelf | AlignSelf | — | |
| as | ElementType<any, keyof IntrinsicElements> | — | |
| className | string | — | |
| columns | number | 1 | Fixed column count. |
| display | "none" | "grid" | "inline-grid" | — | |
| flexBasis | Length | — | |
| flexGrow | number | — | |
| flexShrink | number | — | |
| gap | number | "s" | "m" | "3xs" | "2xs" | "xs" | "l" | "xl" | "2xl" | "3xl" | "4xl" | [number | "s" | "m" | "3xs" | "2xs" | "xs" | "l" | "xl" | "2xl" | "3xl" | "4xl", number | "s" | "m" | ... 7 more ... | "4xl"] | — | |
| height | Length | — | |
| margin | Space | — | |
| marginBlock | Space | — | |
| marginInline | Space | — | |
| maxHeight | Length | — | |
| maxWidth | Length | — | |
| minColWidth | number | — | When set, columns auto-fill with at least this width (px) and `columns` is ignored. |
| minHeight | Length | — | |
| minWidth | Length | — | |
| padding | Space | — | |
| paddingBlock | Space | — | |
| paddingInline | Space | — | |
| position | Position | — | |
| width | Length | — |