Data Table

Filter, sort, select, and paginate tabular data.

Aspyn · TanStack-backed column filters, toolbar, and faceted + date filtering.AspynTanStack-backed column filters, toolbar, and faceted + date filtering.

Installation

import {
  Table,
  TableHeader,
  TableBody,
  TableHead,
  TableRow,
  TableCell,
  DataTableColumnHeader,
  DataTableFacetedFilter,
  DataTableDateFilter,
  DataTableTextFilter,
  DataTableToolbar,
  facetedFilterFn,
  dateRangeFilterFn,
} from "@aspyn-io/kit";

Data table

Filtering, sorting, row selection, column visibility, and pagination — composed from Table plus kit controls and local state.

CustomerEmailStatus
Ada Lovelaceada@aspyn.iopaid$1,200.00
Alan Turingalan@aspyn.iopending$640.00
Grace Hoppergrace@aspyn.iopaid$2,300.00
Katherine Johnsonkj@aspyn.iofailed$89.00

0 of 7 row(s) selected.

Page 1 of 2

Per-column filters (TanStack Table)

Each header carries a funnel that opens a type-aware filter — “contains” text, a faceted multi-select with live counts, and a date range. Backed by @tanstack/react-table; the kit components read and write column filter state.

Ada Lovelacepaid$1,200.00Jan 12, 2026
Alan Turingpending$640.00Feb 3, 2026
Grace Hopperpaid$2,300.00Mar 19, 2026
Katherine Johnsonfailed$89.00Apr 27, 2026
Edsger Dijkstrapaid$410.00May 8, 2026
Barbara Liskovpending$1,750.00Jun 14, 2026
Donald Knuthpaid$980.00Jul 30, 2026

7 of 7 row(s).

Notes

  • Data Table is a pattern, not a single component: it composes Table with Input (filter), Button (sortable headers + pagination), Checkbox (row selection), DropdownMenu (column visibility), and Badge (status).
  • The first example keeps state in React for a self-contained demo. The second wires @tanstack/react-table as the headless engine — DataTableColumnHeader, DataTableFacetedFilter, DataTableDateFilter, and DataTableTextFilter all read and write column filter state directly, so the same components work against server-driven data.
  • Set each column's filterFn to match its control: facetedFilterFn for multi-select, dateRangeFilterFn for the date range, and TanStack's default includesString for text. Faceted counts come from getFacetedUniqueValues().
  • Mark selected rows with data-state="selected" so TableRow gets the muted highlight automatically.