Knit UI
GitHub

Playground

Loading playground…

false
false
true
false
Playground
<Table
  withTableBorder={false}
  withColumnBorders={false}
  withRowBorders
  striped={false}
  highlightOnHover={false}
  horizontalSpacing="xs"
  verticalSpacing="xs"
  captionSide="bottom"
/>

Examples

Compound API

Compound API — Table.Thead, Table.Tbody, Table.Tfoot, Table.Tr, Table.Th, Table.Td.

Loading example…

Compound APISourceStorybook

Data Prop

Data-driven shorthand via the data prop — no JSX children required.

Loading example…

Data PropSourceStorybook

All Borders

Outer table border, column borders, and row borders all enabled together.

Loading example…

All BordersSourceStorybook

Striped

Alternating row background — striped="odd" shades the first, third… rows.

Loading example…

StripedSourceStorybook

Highlight On Hover

Rows highlight on pointer hover — useful for large scannable tables.

Loading example…

Highlight On HoverSourceStorybook

Caption Top

Caption placed above the table via captionSide="top".

Loading example…

Caption TopSourceStorybook

Custom Spacing

Custom spacing — wider horizontal padding and taller rows for a spacious layout.

Loading example…

Custom SpacingSourceStorybook

Styles

Per-slot styles targets individual parts — here the th, td and table.

Loading example…

StylesSourceStorybook

Shadows

The five shadow levels from the shared elevation ladder, mapped over the scale.

Loading example…

ShadowsSourceStorybook

Fully Decorated

All decorative features combined: outer border, column borders, striping, and hover.

Loading example…

Fully DecoratedSourceStorybook

Props

PropTypeDefaultDescription
captionSide"bottom" | "top" | undefined
top · bottom
'bottom'Placement of the caption.
dataTableData | undefinedRender the table from a data object (ignored when `children` is set).
disabled systemboolean | undefined
highlightOnHoverboolean | undefinedfalseHighlights the row under the pointer.
horizontalSpacingTableSpacing | undefined
xxs · xs · sm · md · lg · xl · xxl
'xs'Horizontal cell padding — token name or number.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
unset · xs · sm · md · lg · xl
Elevation — drop shadow from the shared ladder.
stripedboolean | Striped | undefined
false · true · odd · even
falseStripe rows. `true` is equivalent to `"odd"`.
styles systemSlotStyles<TableStyles> | undefinedPer-slot style sugar — props spread onto the matching parts (data path).
theme systemThemeName | null | undefinedApplies a theme to this element
verticalSpacingTableSpacing | undefined
xxs · xs · sm · md · lg · xl · xxl
'xs'Vertical cell padding — token name or number.
withColumnBordersboolean | undefinedfalseDraws borders between columns.
withRowBordersboolean | undefinedtrueDraws borders between rows.
withTableBorderboolean | undefinedfalseDraws a border around the outer table.

Style slots

Every part of Table can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
captionstyles={{ caption: { … } }}
tablestyles={{ table: { … } }}
tbodystyles={{ tbody: { … } }}
tdstyles={{ td: { … } }}
tfootstyles={{ tfoot: { … } }}
thstyles={{ th: { … } }}
theadstyles={{ thead: { … } }}
trstyles={{ tr: { … } }}
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.