Umbra UI

Layout

Box, Stack, Inline, Grid and Container: spacing from tokens, no custom CSS.

Staticimport { Box } from 'umbra-ui'

Props

Box

PropTypeDefaultDescription
as ElementTypedivElement or component to render.
bordered booleanfalseDraws the standard 1px border.
padding "0" | "10" | "0.5" | "1" | "1.5" | "2" | "3" | "4" | "5" | "6" | "8" | "12" | "16"—Padding on all sides, as a spacing token step.
paddingX "0" | "10" | "0.5" | "1" | "1.5" | "2" | "3" | "4" | "5" | "6" | "8" | "12" | "16"—Horizontal padding; overrides `padding` on that axis.
paddingY "0" | "10" | "0.5" | "1" | "1.5" | "2" | "3" | "4" | "5" | "6" | "8" | "12" | "16"—Vertical padding; overrides `padding` on that axis.
radius "sm" | "md" | "lg" | "xs" | "full"—Corner radius token.
surface "bg" | "bg-subtle" | "surface-1" | "surface-2" | "surface-3"—Background layer token.

Stack

PropTypeDefaultDescription
align "center" | "start" | "end" | "stretch" | "baseline"centerCross-axis alignment.
as ElementTypedivElement or component to render.
gap "0" | "10" | "0.5" | "1" | "1.5" | "2" | "3" | "4" | "5" | "6" | "8" | "12" | "16"4Space between children, as a spacing token step.
justify "center" | "start" | "end" | "between"startMain-axis distribution.

Inline

PropTypeDefaultDescription
align "center" | "start" | "end" | "stretch" | "baseline"centerCross-axis alignment.
as ElementTypedivElement or component to render.
gap "0" | "10" | "0.5" | "1" | "1.5" | "2" | "3" | "4" | "5" | "6" | "8" | "12" | "16"4Space between children, as a spacing token step.
justify "center" | "start" | "end" | "between"startMain-axis distribution.
wrap booleantrueAllow children to wrap onto new lines.

Grid

PropTypeDefaultDescription
as ElementTypedivElement or component to render.
columns string | number1Fixed number of equal columns, or any `grid-template-columns` value. Ignored when `minItemWidth` is set.
gap "0" | "10" | "0.5" | "1" | "1.5" | "2" | "3" | "4" | "5" | "6" | "8" | "12" | "16"4Space between cells, as a spacing token step.
minItemWidth string—Responsive mode: fit as many columns as possible, each at least this wide (CSS length).

Container

PropTypeDefaultDescription
as ElementTypedivElement or component to render.
size "sm" | "md" | "lg" | "xl"lgMaximum content width.

Usage notes

gap and padding take spacing token steps ("4" is 16px). Every primitive accepts as.

Accessibility

  • Layout primitives add no semantics: use as for landmarks (as="main", as="nav").

Import

import { Box, Stack, Inline, Grid, Container } from 'umbra-ui';
import 'umbra-ui/styles.css'; // once, at the root of your app