Skip to content
Calm motion: animations on this site only fade, with no movement

Grid ​

Responsive columns with token gap

Basic
1
2
3
4
5
6
  • min alone fits as many columns as the width holds. Each column is at least min wide (16rem by default).
  • columns alone is a fixed count. Use it inside a box that you know is wide enough.
  • columns and min together give at most that many columns. When the box gets narrow, the grid drops columns before a column gets narrower than min. The demo does this: resize the window to see 3, 2, then 1 column.
  • Each column is minmax(0, 1fr), so a wide child such as a table cannot push the grid wider than its box.

Usage ​

ts
import { BlessGrid } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
asstring"div"
columnsnumber—the most columns. Alone, it is a fixed count
minstring—the narrowest a column can be, for example "16rem". With `columns`, the grid drops columns before they get narrower
gap1 | 2 | 3 | 4 | 6 | 8 | 12 | 164space token key
align"start" | "end" | "center" | "stretch""stretch"

Slots

NameScopeDescription
default—

Released under the MIT License. Character names and artwork belong to their owners.