@velocis/table2
v0.2.3
Published
Highly flexible data tables with render-prop columns, optional selection, and full styling control.
Readme
@velocis/table2
Highly flexible data tables with render-prop columns, optional selection, and full styling control.
Consumer import: velocis/table2
Full reference: docs/table2.md
Exports
| Export | Use case |
|--------|----------|
| Table2 | Main table component (compound root) |
| Table2.Pagination | Standalone pagination bar |
| Table2.Checkbox | Selection checkbox with indeterminate state |
| useTable2Pagination | Client-side page slicing |
| useTable2Selection | Row selection with page-level select-all |
| cardRowStyles | Card-row appearance preset classes |
import { Table2, useTable2Pagination, useTable2Selection } from 'velocis/table2';
const { pageRows, page, totalPages, nextPage, prevPage } = useTable2Pagination({ rows: data });
const { selectionColumn } = useTable2Selection({ pageIds: pageRows.map((r) => r.id) });
<Table2
rows={pageRows}
columns={columns}
appearance="card"
selection={selectionColumn}
pagination={{ currentPage: page, totalPages, onNext: nextPage, onPrev: prevPage }}
/>