Knit UI
GitHub

Playground

Loading playground…

Playground
<Box
  padding="$md"
  backgroundColor="$background"
/>

Examples

Flex Row

Box as a flex row container — the foundation for horizontal layouts.

Loading example…

Flex RowSourceStorybook

Flex Column

Box as a flex column container — stack children vertically with a gap.

Loading example…

Flex ColumnSourceStorybook

Spacing Tokens

Spacing tokens applied as padding and margin — $xs through $xl.

Loading example…

Spacing TokensSourceStorybook

Themed Surfaces

Theme token for background and border — Box picks up the active theme palette.

Loading example…

Themed SurfacesSourceStorybook

Nested

Nested Box elements — demonstrates natural composition and depth.

Loading example…

NestedSourceStorybook

Shadows

Elevation via the shared shadow ladder — Box is the source of the shadow prop every other component inherits; no shadow unless set.

Loading example…

ShadowsSourceStorybook

Opacity

Reduced opacity — Box supports the opacity prop directly.

Loading example…

OpacitySourceStorybook

Props

PropTypeDefaultDescription
disabled systemboolean | undefined
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
theme systemThemeName | null | undefinedApplies a theme to this element
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 498 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.