TrademarkTrademark
Docs
Ctrl k
Search docs...
Components

Table

Updated: May 9, 2025
View on GitHub

Table is used to organize and render lists of information in a column/row format. It supports sorting, optional click handlers, and flexible cell content using ReactNode.

Sorting

Enable sorting per column by setting sortable: true on the corresponding header. Click toggles between ascending and descending.

Row actions

Add onRowClick to make rows interactive. A hover state is applied automatically.

Enable searchable to filter rows by cell content. Use searchPlaceholder to customize the input label.

Pagination

Set paginated to split large datasets into pages. Control the default page size with defaultPageSize and pageSizeOptions.

Loading and empty states

Use loading to show a spinner while data is fetched. Provide emptyState or loadingState for custom placeholders.

API reference

Type
Default
datarequired
Headers and rows. Cells are ReactNodes, so anything can go in one.
{ headers: TableHeader[]; rows: ReactNode[][]; }—
onRowClick
Called with the row index. Rows become focusable when set.
(rowIndex: number) => void—
searchable
Add a search field that filters rows.
booleanfalse
searchPlaceholder
Placeholder for that field.
stringSearch...
striped
Alternate row backgrounds.
booleanfalse
hoverable
Highlight the row under the pointer.
booleantrue
compact
Tighter row height, for dense data.
booleanfalse
loading
Swap the rows for the loading state.
booleanfalse
emptyState
What to render when there are no rows.
ReactNode—
actions
Row actions, rendered in a trailing column.
TableAction[]—
stickyHeader
Keep the header visible while the body scrolls.
booleanfalse
rowClassName
Per-row class, by index.
(rowIndex: number) => string—
cellClassName
Per-cell class, by row and column index.
(rowIndex: number, cellIndex: number) => string—
paginated
Page the rows instead of rendering all of them.
booleanfalse
defaultPageSize
Rows per page before the reader changes it.
number10
pageSizeOptions
The sizes offered in the page-size control.
number[][5, 10, 20, 50]
loadingState
What to render while loading.
ReactNode—
…and every FlexProps propinherited—
maxHeight
string—
className
string—
style
React.CSSProperties—

TableAction

Type
Default
icon
string—
label
string—
tooltip
string—
variant
primarysecondarytertiarydanger
secondary
onClick
(rowIndex: number) => void—
disabled
(rowIndex: number) => boolean—
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club