Skip to content
nexubDesign System
v2.4.0

Components · Data Display

Data Table

StableSince v0.0.1

Feature-rich data table with sorting and row selection powered by TanStack Table.

import { DataTable } from '@nexub/react';

Examples

Default

With sorting

Props

Props
PropTypeDefaultDescription
columnsrequiredDataTableColumn<TData>[]—TanStack Table column definitions (DataTableColumn is exported from @nexub/react). Set meta: { align: 'end' } for numeric columns; headers, sort buttons and cells follow it.
captionReactNode—Names the table for assistive tech (and its scroll region). Shown below the table; add captionHidden to keep it screen-reader only.
datarequiredTData[]—Array of row data objects to render.
enableSortingbooleanfalseEnables click-to-sort on column headers.
enableRowSelectionbooleanfalseAdds a checkbox column for row selection.
pagination.pageSizenumber10Number of rows per page when pagination is active.
pagination.pageIndexnumber0Zero-based index of the currently visible page.
onRowSelectionChange(selectedRows: TData[]) => void—Callback invoked when the row selection state changes.
loadingbooleanfalseShows a skeleton loading state over the table body.
emptyStateReact.ReactNode—Custom content rendered when the data array is empty.

On iOS & Android