Components

Table

Tables display sets of data across rows and columns for easy scanning and comparison.

Tables are used to organize and display data efficiently. The Table components are composable primitives that can be assembled to build any table layout, while DataTable provides a quick way to render tabular data from columns and data props.

Basic table

Compose Table, TableHead, TableBody, TableRow and TableCell to build a table from scratch.

NameStatusViews
HomepagePublished12,847
About UsDraft3,291
ContactPublished1,082
Blog Post #1Review847

With badges

Use TableBadge inside a cell to highlight status values. It maps to the design system's badge utility classes and supports 'default' | 'brand' | 'accent' | 'success' | 'warning' | 'error' | 'info' | 'solid-*' variants.

NameStatusViews
HomepagePublished12,847
About UsDraft3,291
ContactPublished1,082
Blog Post #1Review847

Hover & striped

Pass hover to highlight rows on hover, or striped to apply alternating row backgrounds.

NameStatusViews
HomepagePublished12,847
About UsDraft3,291
ContactPublished1,082
Blog Post #1Review847

Data table

DataTable accepts columns and data props and renders the table for you. Each column can define a custom render function for the cell content.

NameStatusViews
HomepagePublished12,847
About UsDraft3,291
ContactPublished1,082
Blog Post #1Review847

API

See the documentation below for a complete reference to all of the props available to the Table components.

DataTable Props
PropTypeDefaultDescription
columnsTableColumn[]Column definitions: key, header, optional align and render.
dataT[]Array of row objects to render.
getRowKey(row: T, index: number) => React.KeyReturns a unique key for each row.
TableColumn
PropTypeDefaultDescription
keykeyof TThe row property to read the cell value from.
headerReactNodeContent rendered in the column header cell.
align'left' | 'center' | 'right''left'Text alignment for the header and cell.
render(value, row: T) => ReactNodeCustom renderer for the cell content.
TableBadge Props
PropTypeDefaultDescription
variant'default' | 'brand' | 'accent' | 'success' | 'warning' | 'error' | 'info' | 'solid-brand' | 'solid-success' | 'solid-warning' | 'solid-error' | 'solid-info''default'The badge utility class applied to the cell.
Table Props
PropTypeDefaultDescription
hoverbooleanfalseHighlights rows on hover.
stripedbooleanfalseApplies alternating row backgrounds.
TableHeaderCell / TableCell Props
PropTypeDefaultDescription
align'left' | 'center' | 'right''left'Text alignment of the cell content.