gap
Utilities for controlling gutters between grid and flexbox items.
| Class | Effect |
|---|---|
gap-<number> |
gap: calc(var(--spacing) * <value>); |
gap-px |
gap: 1px; |
gap-[<value>] |
gap: <value>; |
gap-x-<number> |
column-gap: calc(var(--spacing) * <value>); |
gap-x-px |
column-gap: 1px; |
gap-x-[<value>] |
column-gap: <value>; |
gap-y-<number> |
row-gap: calc(var(--spacing) * <value>); |
gap-y-px |
row-gap: 1px; |
gap-y-[<value>] |
row-gap: <value>; |
Examples
Section titled “Examples”Basic example
Section titled “Basic example”Use gap-<number> to change the gutter between rows and columns.


if ui.div("grid grid-cols-2 gap-4") { tile("01") tile("02") tile("03") tile("04")}Changing row and column gaps independently
Section titled “Changing row and column gaps independently”

if ui.div("grid grid-cols-3 gap-x-8 gap-y-4") { for i in 1 ..= 6 { ui.key(i) tile(fmt.tprintf("%02d", i)) }}