docs/components/data/Table

Table

Data table with typed columns, sorting, and selection.

import { Table } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#Props

PropTypeDefaultDescription
columns *TableColumn<T>[]Column definitions.
data *T[]Data rows to display.
onRowClick(item: T) => voidCallback when a row is clicked.
selectedKeystring | nullKey of the currently selected row.
getRowKey *(item: T) => stringFunction to extract unique key from each row.
sortColumnstringKey of the currently sorted column.
sortDirection'asc' | 'desc'Current sort direction.
onSort(column: string, direction: 'asc' | 'desc') => voidCallback when column header is clicked for sorting.
emptyStateJSX.Element | stringContent shown when data array is empty.

* required prop.