Knit UI
GitHub

Playground

Loading playground…

Playground
<Spacer
  w="md"
  h="md"
/>

Examples

Horizontal

Horizontal spacer — reserves a fixed amount of space between two inline elements.

Loading example…

HorizontalSourceStorybook

Vertical

Vertical spacer — reserves a fixed amount of vertical space between stacked elements.

Loading example…

VerticalSourceStorybook

Spacer Sizes

Multiple spacer sizes using size tokens — shows how spacing scales across a row.

Loading example…

Spacer SizesSourceStorybook

Flex Grow

Flex-grow layout — Spacer with flex={1} expands to fill available space, pushing siblings apart.

Loading example…

Flex GrowSourceStorybook

Minimum Size

Minimum size guarantee — the spacer resists collapsing even inside a flex container that tries to shrink it.

Loading example…

Minimum SizeSourceStorybook

Props

PropTypeDefaultDescription
disabled systemboolean | undefined——
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined——
theme systemThemeName | 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.

Edit this page on GitHub