Skip to content
nexubDesign System
v12.7.0

Components · Data Display

Table

StableAdded v0.0.1

Semantic HTML table with styled variants.

import { Table } from '@nexub/react';
View as Markdown

Playground

Props

NameStatusDate
Alice BrownActiveJan 15, 2026
Bob CarterPendingJan 14, 2026
Carol DavisInactiveJan 10, 2026
TSX
<Table.Root className="w-full max-w-120">…</Table.Root>

Examples

Default

NameStatusDate
Alice BrownActiveJan 15, 2026
Bob CarterPendingJan 14, 2026
Carol DavisInactiveJan 10, 2026

With caption

Recent user activity — last 30 days
NameStatusDate
Alice BrownActiveJan 15, 2026
Bob CarterPendingJan 14, 2026
Carol DavisInactiveJan 10, 2026
Showing 3 of 3 users

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.

NameRole
Person 1Admin
Person 2Member
Person 3Member
Person 4Admin
Person 5Member
Person 6Member
Person 7Admin
Person 8Member
Person 9Member
Person 10Admin
Person 11Member
Person 12Member

Props

Props
PropTypeDefaultDescription
Table.Root stripedbooleanfalseApplies alternating row background colours.
Table.Root borderedbooleanfalseAdds borders between rows and columns.
Table.Root hoverablebooleanfalseHighlights rows on mouse hover.
Table.Root stickyHeaderbooleanfalseFixes 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.
maxHeightstring | number—Caps the scroll container's height; a number is pixels.
scrollLabelstring—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.
stickyHeaderboolean—Keeps the header row in view while the body scrolls. Set maxHeight so there is something to scroll.
stripedboolean—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.

Table design tokens
TokenAliasesNotes
--table-head-bgtransparentDefault: transparent
--table-head-fg--color-on-surface-muted—
--table-border--color-outline-variantRow rules.
CSS
/* One area of your app */
.checkout {
  --table-head-bg: var(--color-secondary);
}