DS0
Components

DataTable

Feature-rich table component with built-in sorting, filtering, row selection, and pagination for structured datasets.

Overview

DataTable extends Table with interactive features: column sorting, text/column filtering, row selection with checkboxes, and built-in pagination. Designed for datasets that users need to explore and act on.

Usage

<DataTable
  columns={[
    { key: 'name', header: 'Name', sortable: true },
    { key: 'email', header: 'Email', sortable: true },
    { key: 'role', header: 'Role', filterable: true },
  ]}
  data={users}
  selectable
  paginated
  pageSize={10}
/>

API Reference

PropTypeDefaultDescription
columnsColumnDef[][]Column definitions
dataRecord<string, unknown>[][]Row data
selectablebooleanfalseEnable row selection
paginatedbooleanfalseEnable pagination
pageSizenumber10Rows per page
onSelectionChange(rows: unknown[]) => voidSelection handler

Accessibility

  • Sortable columns have aria-sort attribute
  • Row checkboxes have aria-label
  • Pagination uses nav with aria-label
ComponentWhen to Use Instead
TableSimple static data display
VirtualizedListVery large datasets (1000+ rows)

On this page