Layout@knitui/components
Spacer
Spacer is a fixed-size invisible element that reserves space between other elements. Set w for horizontal gaps and h for vertical gaps. miw/mih default to w/h so the space never collapses.
import { Spacer } from "@knitui/components";Playground
Loading playground…
<Spacer
w="md"
h="md"
/>Examples
Horizontal
Horizontal spacer — reserves a fixed amount of space between two inline elements.
Loading example…
Vertical
Vertical spacer — reserves a fixed amount of vertical space between stacked elements.
Loading example…
Spacer Sizes
Multiple spacer sizes using size tokens — shows how spacing scales across a row.
Loading example…
Flex Grow
Flex-grow layout — Spacer with flex={1} expands to fill available space, pushing siblings apart.
Loading example…
Minimum Size
Minimum size guarantee — the spacer resists collapsing even inside a flex container that tries to shrink it.
Loading example…
Props
| Prop | Type | Default | Description |
|---|---|---|---|
disabled system | boolean | undefined | — | — |
shadow system | "xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined | — | — |
theme system | ThemeName | null | undefined | — | Applies a theme to this element |
Plus 805 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.