Data table
A live demo against a mocked server in your browser — the block is the registry's own source.
Install
Section titled “Install”npx shadcn add @mantle/data-tableNeeds a React Aria shadcn project and the @mantle registry in components.json — see
Install. The block lands in components/mantle/data-table.tsx, yours to edit.
Works with any service that returns Paginated<T> (every RepositoryService does).
import { DataTable } from "@/components/mantle/data-table";
<DataTable<Article> service="articles" aria-label="Articles" pageSize={20} columns={[ { id: "title", header: "Title", sortable: true }, { id: "views", header: "Views", sortable: true }, ]}/>;- Column sort descriptors become
$sort, pages become$skip/$limit, and visible columns become$select. - Built on shadcn’s aria
Table(React AriaTable/Column), with sortable headers announced to screen readers. - Pagination controls appear automatically when the result is a
Paginated<T>envelope.