Skip to content

TkxDataGrid

import { TkxDataGrid } from 'tekivex-ui';
Basic — sortable columns + bordered
Priya Kumarpriya@example.comAdminActive
Marcus Leemarcus@example.comEditorActive
Sara Chensara@example.comViewerPending
Diego Vegadiego@example.comEditorActive
Aisha Patelaisha@example.comAdminInvited
<TkxDataGrid
data={users}
rowKey="id"
sortable
bordered
columns={[
{ key: 'name', label: 'Name', sortable: true },
{ key: 'email', label: 'Email' },
{ key: 'role', label: 'Role', sortable: true },
]}
/>
Row selection — controlled
1 of 5 rows selected
Priya Kumarpriya@example.comAdmin
Marcus Leemarcus@example.comEditor
Sara Chensara@example.comViewer
Diego Vegadiego@example.comEditor
Aisha Patelaisha@example.comAdmin

Selected IDs: ["2"]

const [selected, setSelected] = useState<string[]>([]);
<TkxDataGrid
data={users}
rowKey="id"
selectable
selectedRows={selected}
onSelectionChange={setSelected}
columns={[...]}
/>
PropTypeRequiredDescription
columnsDataGridColumn<T>[]yes
dataT[]yes
rowKeystring | ((row: T) => string)yes
selectableboolean
selectedRowsstring[]
onSelectionChange(ids: string[]) => void
sortablebooleanEnable column sorting. When true, clicks sort data client-side unless onSort is also provided.
onSort(key: string, direction: 'asc' | 'desc') => voidExternal sort handler. When provided, raw data is NOT sorted internally — you must pass pre-sorted data.
loadingboolean
emptyMessagestring
stickyHeaderboolean
stripedboolean
borderedboolean
compactboolean
maxHeightnumber | string
onRowClick(row: T) => void
virtualScrollbooleanEnable virtual scrolling. Defaults to auto (enabled when data ≥ 50 rows and maxHeight is set).
rowHeightnumberRow height in pixels for virtual scrolling calculations. Default: 40
showFiltersbooleanShow column filter inputs below the header row.
filterValuesRecord<string, string>Controlled filter values keyed by column key.
onFilterChange(key: string, value: string) => voidCalled when a column filter changes.
pageSizenumberRows per page for built-in pagination. Set to 0 to disable. Default: 0 (disabled).
showExportbooleanShow a CSV export button in the toolbar.
exportFileNamestringFile name for CSV export (without .csv extension). Default: “export”.
onLoadMore() => void | Promise<void>Called when the user scrolls near the bottom. Use to fetch more data.
hasMorebooleanWhether more data is available to load. When false, sentinel is hidden.
loadingMorebooleanShow a loading skeleton at the bottom while fetching more data.
loadMoreThresholdnumberHow many pixels from the bottom to trigger onLoadMore. Default: 200
  • Keyboard navigation supported on all interactive elements
  • :focus-visible outline at 2px (theme-token primary)
  • ARIA roles and properties applied per WAI-ARIA 1.2
  • Respects prefers-reduced-motion
  • Minimum 44×44 touch target where applicable

The implementation lives at src/components/TkxDataGrid.tsx.

For tree-data, column pinning, row grouping, infinite scroll, and the full prop matrix, open the playground or the DataGrid recipe.