datui
Color scheme

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.

PropTypeDefaultDescription
align"center" | "start" | "end" | "stretch" | "baseline"—
alignSelfAlignSelf—
asElementType<any, keyof IntrinsicElements>—
classNamestring—
columnsnumber1Fixed column count.
display"none" | "grid" | "inline-grid"—
flexBasisLength—
flexGrownumber—
flexShrinknumber—
gapnumber | "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"]—
heightLength—
marginSpace—
marginBlockSpace—
marginInlineSpace—
maxHeightLength—
maxWidthLength—
minColWidthnumber—When set, columns auto-fill with at least this width (px) and `columns` is ignored.
minHeightLength—
minWidthLength—
paddingSpace—
paddingBlockSpace—
paddingInlineSpace—
positionPosition—
widthLength—