Components/DataTable
Since 1.0.0BETA

DataTable

Lightweight data table with sorting and selection

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

DataTable

Lightweight data table with sorting, row selection, and custom rendering.

Basic Usage

Demo loads on client.

Row Selection

Demo loads on client.

API

TxDataTable Props

NameTypeDefaultDescription
columnsDataTableColumn[][]Column config
dataany[][]Data source
rowKeystring | (row, index) => string | numberindexUnique row key
loadingbooleanfalseLoading state
emptyTextstring'No data'Empty text
stripedbooleanfalseZebra rows
borderedbooleanfalseShow borders
hoverbooleantrueHover highlight
selectablebooleanfalseSelectable rows
selectedKeysArray<string | number>[]Selected keys
defaultSort{ key: string; order: 'asc' | 'desc' | null }nullDefault sort
sortOnClientbooleantrueClient-side sort

DataTableColumn

FieldTypeDescription
keystringColumn key
titlestringHeader title
dataIndexstringData field
widthstring | numberColumn width
align'left' | 'center' | 'right'Alignment
sortablebooleanSortable
sorter(a, b) => numberCustom sorter
format(value, row, index) => stringCell formatter
headerClassstringHeader class
cellClassstringCell class

Events

EventPayloadDescription
update:selectedKeys(keys)Selection update
selectionChange(keys)Selection change
sortChange(sort)Sort change
rowClick({ row, index })Row click

Slots

NameDescription
header-<columnKey>Custom header
cell-<columnKey>Custom cell
emptyEmpty slot
Was this helpful?