RZREDZ.UI

Layout

The parent sets the grid, the number is the count, and a width prefix measures the region the element is in. Stacks for a column or a row of items, gaps between them, no margins on components.

Grids

grid on the parent, cols-N for N equal columns, gap-* between them. A width prefix adds columns as the region grows: grid md:cols-2 is one column until the region is 768 px wide. Every example on these pages is a region of its own - resize the window and watch the examples, not the window.

One
Two
Three
Four
<div class="grid sm:cols-2 lg:cols-4 gap-16">
	<div class="card"><div class="card-body">One</div></div>
	<div class="card"><div class="card-body">Two</div></div>
	<div class="card"><div class="card-body">Three</div></div>
	<div class="card"><div class="card-body">Four</div></div>
</div>

Spans on a 12-column grid

A child's exception: span-N or span-full, with a prefix where it changes.

The main column - md:span-8
The side - md:span-4
<div class="grid md:cols-12 gap-16">
	<div class="card md:span-8"><div class="card-body">The main column - <code>md:span-8</code></div></div>
	<div class="card md:span-4"><div class="card-body">The side - <code>md:span-4</code></div></div>
</div>

As many as fit

cols-min-240: as many columns as fit, none narrower than 240 px.

lagoon.example
villas.lagoon.example
northbay.example
<div class="grid cols-min-160 gap-12">
	<div class="card"><div class="card-body">lagoon.example</div></div>
	<div class="card"><div class="card-body">villas.lagoon.example</div></div>
	<div class="card"><div class="card-body">northbay.example</div></div>
</div>

Stacks

vstack is a column of items, hstack a row of them centered on one line; gap-* spaces them and ms-auto pushes the rest to the end.

Draft Edited 2 hours ago
<div class="hstack gap-8">
	<span class="badge">Draft</span>
	<span class="text-muted">Edited 2 hours ago</span>
	<button class="btn btn-sm ms-auto" type="button">Preview</button>
	<button class="btn btn-sm btn-primary" type="button">Publish</button>
</div>

Regions and breakpoints

Regions are the shell's main and side columns, cards, dialogs, drawers, and any block with the class region. A page without the shell marks its own region; the root is never one.

PrefixThe region is at least
sm:576 px
md:768 px
lg:1024 px
xl:1280 px
2xl:1536 px
print:on paper
  • A region inside a flex row needs a width - flex-grow-1 or a grid track: its size cannot come from its content.
  • A card in the 8-of-12 column at 1440 px is about 740 px wide: sm: inside it, not md:.

From Bootstrap 5.3

Bootstrap 5.3REDZ.UIChangeNote
col-gridequal columns come from the parent's cols-N; the child needs no class
col-1span-1gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-10span-10gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-11span-11gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-12span-12gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-2span-2gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-3span-3gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-4span-4gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-5span-5gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-6span-6gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-7span-7gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-8span-8gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-9span-9gridN of 12: the parent is grid cols-12 (or md:cols-12)
col-auto-reviewa column as wide as its content: hstack, or grid-template-columns in the module's CSS
container-reviewthe shell's app-main, or a region with max-w-* and mx-auto
container-fluid-reviewthe shell's app-main, or a region with max-w-* and mx-auto
g-0gap-0gridon the grid parent
g-1gap-4gridon the grid parent
g-2gap-8gridon the grid parent
g-3gap-16gridon the grid parent
g-4gap-24gridon the grid parent
g-5gap-48gridon the grid parent
gx-0column-gap-0gridon the grid parent
gx-1column-gap-4gridon the grid parent
gx-2column-gap-8gridon the grid parent
gx-3column-gap-16gridon the grid parent
gx-4column-gap-24gridon the grid parent
gx-5column-gap-48gridon the grid parent
gy-0row-gap-0gridon the grid parent
gy-1row-gap-4gridon the grid parent
gy-2row-gap-8gridon the grid parent
gy-3row-gap-16gridon the grid parent
gy-4row-gap-24gridon the grid parent
gy-5row-gap-48gridon the grid parent
offset-1-reviewno offsets: a span with an empty track before it
offset-10-reviewno offsets: a span with an empty track before it
offset-11-reviewno offsets: a span with an empty track before it
offset-2-reviewno offsets: a span with an empty track before it
offset-3-reviewno offsets: a span with an empty track before it
offset-4-reviewno offsets: a span with an empty track before it
offset-5-reviewno offsets: a span with an empty track before it
offset-6-reviewno offsets: a span with an empty track before it
offset-7-reviewno offsets: a span with an empty track before it
offset-8-reviewno offsets: a span with an empty track before it
offset-9-reviewno offsets: a span with an empty track before it
rowgridgridon the parent, with cols-N for equal columns or cols-12 for spans; no gutters to undo
row-cols-1cols-1gridon the same parent
row-cols-2cols-2gridon the same parent
row-cols-3cols-3gridon the same parent
row-cols-4cols-4gridon the same parent
row-cols-5cols-5gridon the same parent
row-cols-6cols-6gridon the same parent
row-cols-auto-reviewitems as wide as their content: hstack flex-wrap
--bs-breakpoint-xs-removeREDZ.UI's widths are the region prefixes sm: to 2xl:
--bs-gutter-x-reviewthe grid's gap: gap-* on the grid
--bs-gutter-y-reviewthe grid's gap: gap-* on the grid