$ rezi
Widgets

Row / Column

Stacks children horizontally (row) or vertically (column).

Stacks children horizontally (row) or vertically (column).

Usage

import { ui } from "@rezi-ui/core";

ui.row({ gap: 2 }, [ui.text("A"), ui.text("B")]);
ui.column({ gap: 1, p: 1 }, [ui.text("A"), ui.text("B")]);

Props

PropTypeDefaultDescription
idstring-Optional identity (not focusable)
keystring-Reconciliation key
gapSpacingValue1Spacing between children
reversebooleanfalseReverse child visual order
align"start" | "center" | "end" | "stretch""start"Cross-axis alignment
justify"start" | "end" | "center" | "between" | "around" | "evenly" (also CSS aliases: "space-between", "space-around", "space-evenly")"start"Main-axis distribution
p, px, py, pt, pr, pb, plSpacingValue-Padding props
m, mx, mySpacingValue-Margin props
width, heightnumber | \"auto\" | \"full\" | \"${number}%\"-Size constraints
minWidth, maxWidth, minHeight, maxHeightnumber-Size bounds (cells)
flexnumber-Main-axis flex in parent stack
aspectRationumber-Enforce width/height ratio
styleTextStyle-Container style override; bg fills rect
inheritStyleTextStyle-Descendant default style without fill

Examples

1) Spacer for “push to the right”

import { ui } from "@rezi-ui/core";

ui.row({ gap: 1 }, [
  ui.text("Left"),
  ui.spacer({ flex: 1 }),
  ui.text("Right"),
]);

2) Align + justify

import { ui } from "@rezi-ui/core";

ui.column({ height: 6, justify: "between" }, [
  ui.text("Top"),
  ui.row({ justify: "end" }, [ui.text("Bottom-right")]),
]);

Helpers

Rezi also includes:

  • ui.hstack(...) — shorthand row with default gap: 1
  • ui.vstack(...) — shorthand column with default gap: 1
  • ui.spacedHStack(...) — shorthand row with default gap: 1 (alias)
  • ui.spacedVStack(...) — shorthand column with default gap: 1 (alias)
  • Spacer - Flexible/fixed spacing
  • Layout - Alignment, constraints, nesting

On this page