Open source React component
React Table
A fast, accessible data table for React. Sorting, filtering, grouping, editing, paging and virtual scrolling work out of the box, and you take full control of the state when you need it.
A live ka-table: sort by the headers, filter, click a cell to edit it
The live table could not be loaded. Open the demos
Quick start
Your first table in a minute
Install the package, import the styles and pass the columns and the data. Sorting, filtering, editing and paging are one prop each.
npm install ka-table
import 'ka-table/style.css';
import { Table } from 'ka-table';
import { DataType, SortingMode } from 'ka-table/enums';
const columns = [
{ key: 'name', title: 'Name', dataType: DataType.String },
{ key: 'score', title: 'Score', dataType: DataType.Number },
];
const data = [
{ id: 1, name: 'Ava Brooks', score: 92 },
{ id: 2, name: 'Liam Carter', score: 78 },
];
export const App = () => (
<Table
columns={columns}
data={data}
rowKeyField="id"
sortingMode={SortingMode.Single}
/>
);Features
Everything a data table needs
Every feature has a demo with the code and a page in the docs.
TypeScript
The type of the rows is inferred from your data, and every action of the table is typed.
Your design
Customize every part
Render your own cells, rows, editors, header cells and pager with childComponents, and add any event handlers. The styles are plain CSS with --ka-* custom properties: change the colors, switch on the dark theme, or style the table with Bootstrap or Material UI.
ka-table 13
What's new
- Fixed columns.
fixed: 'left'or'right'keeps a column at the edge while the table scrolls. - Keyboard navigation. The table is a WAI-ARIA grid with a single Tab stop, on by default.
- Virtual columns.
virtualScrolling.horizontalrenders only the visible columns. - Memoized rows. With
memoizedRowsonly the changed rows are rendered again: 300K rows stay fast. - Themes in plain CSS.
--ka-*custom properties and a dark theme, no Sass. - Typed actions.
TableActionis narrowed byaction.type, anduseTableSelector()re-renders only on the selected value. - React 18 and 19. An ES2019 build with CommonJS and ES modules.
Free and open source
ka-table is MIT licensed: use it in any project, commercial ones included. Issues, ideas and pull requests are welcome.