Components · Data Display
Table
Semantic HTML table with styled variants.
import { Table } from '@nexub/react';Playground
Props
| Name | Status | Date |
|---|---|---|
| Alice Brown | Active | Jan 15, 2026 |
| Bob Carter | Pending | Jan 14, 2026 |
| Carol Davis | Inactive | Jan 10, 2026 |
<Table.Root className="w-full max-w-120">…</Table.Root>Examples
Default
With caption
Sticky header, compact and striped
`stickyHeader` with `maxHeight` keeps the header in view, `density="compact"` tightens this table only, and `striped` tints every other row.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| Table.Root striped | boolean | false | Applies alternating row background colours. |
| Table.Root bordered | boolean | false | Adds borders between rows and columns. |
| Table.Root hoverable | boolean | false | Highlights rows on mouse hover. |
| Table.Root stickyHeader | boolean | false | Fixes the table header to the top when scrolling inside a scrollable container. |
| Table.Head align | 'start' | 'center' | 'end' | 'start' | Text alignment within the header cell. |
| Table.Cell align | 'start' | 'center' | 'end' | 'start' | Text alignment within the data cell. |
| Table.Caption side | 'top' | 'bottom' | 'bottom' | Whether the caption appears above or below the table. |
| density | 'comfortable' | 'compact' | — | Row height and cell padding for this table only. Unset: inherits the page density. |
| maxHeight | string | number | — | Caps the scroll container's height; a number is pixels. |
| scrollLabel | string | — | Accessible name of the scroll region shown when the table overflows horizontally. Falls back to the table's aria-label/aria-labelledby, then its caption. |
| stickyHeader | boolean | — | Keeps the header row in view while the body scrolls. Set maxHeight so there is something to scroll. |
| striped | boolean | — | Tints every other body row. Hover and selected rows still stand out. |
Design tokens
Table reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Table below it, and leave the roles other components share alone. See the three token tiers.
| Token | Aliases | Notes |
|---|---|---|
| --table-head-bg | transparent | Default: transparent |
| --table-head-fg | --color-on-surface-muted | — |
| --table-border | --color-outline-variant | Row rules. |
/* One area of your app */
.checkout {
--table-head-bg: var(--color-secondary);
}On iOS & Android: Table
import { Table } from '@nexub/react-native';
<Table.Root stickyFirstColumn columns={[120, 88, 88]}>
<Table.Header>
<Table.Row>
<Table.Head>Team</Table.Head>
<Table.Head numeric>Played</Table.Head>
<Table.Head numeric>Points</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>Rovers</Table.Cell>
<Table.Cell numeric>12</Table.Cell>
<Table.Cell numeric>29</Table.Cell>
</Table.Row>
</Table.Body>
</Table.Root>Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Column widths | Table layout: columns size to their content. | Set per column with columns on Root (128pt when unset); the last column fills what is left. |
| Sticky | stickyHeader with maxHeight. | stickyFirstColumn; rows are then one line high. No sticky header: the screen scrolls. |
| Screen readers | Native table semantics. | Each row is one element read as "Header: value" pairs; accessible={false} on a Row frees its controls. |
| States | Body can show loading, empty and error states. | Not built in; use Skeleton, EmptyState and ErrorState around the table. |
| Extra | No divider prop. | dividerAfter draws a heavier line under a row (the cut in a ranked list). |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.