Knit UI
GitHub

Playground

Loading playground…

false
Playground
<Center
  inline={false}
  width="$xxl"
  height="$xxl"
  backgroundColor="$color3"
  borderRadius="$md"
>
  <Text>Center</Text>
</Center>

Examples

Default

Default block centering — content is centered on both axes inside a fixed container.

Loading example…

DefaultSourceStorybook

Inline

Inline variant — the container shrinks to content width and sits inline with surrounding text.

Loading example…

InlineSourceStorybook

Nested Children

Centering nested element children — any React node is centered correctly.

Loading example…

Nested ChildrenSourceStorybook

Multiple Containers

Multiple Center containers side by side — each cell centers its own content.

Loading example…

Multiple ContainersSourceStorybook

Full Width

Full-width centering pattern — stretch to the parent and center a card inside.

Loading example…

Full WidthSourceStorybook

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 499 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.