Lambchop
Data Management

DataTable

Feature-rich table with sorting, pagination, and search.

import { DataTable } from "lambchop";

Live Demo

Title
Author
Site
Revenue
Pageviews
New Album Review: Converge - BloodmoonAlex H.noecho.net$142.508,200
Meshuggah Announce Farewell TourJordan P.melodicmag.com$218.3012,400
Deftones Studio UpdateCasey M.theneedledrop.com$95.205,600
Top 10 Metalcore Albums of JanuaryTaylor R.metalinsider.net$310.8018,900
Between the Buried and Me InterviewAlex H.ghostcultmag.com$78.904,200
Page 1 of 2

Usage

import { DataTable, type ColumnDef } from "lambchop";
import { createColumnHelper } from "@tanstack/react-table";

interface Row {
  title: string;
  revenue: number;
}

const columnHelper = createColumnHelper<Row>();
const columns = [
  columnHelper.accessor("title", { header: "Title" }),
  columnHelper.accessor("revenue", {
    header: "Revenue",
    cell: (info) => `$${info.getValue().toFixed(2)}`,
  }),
];

<DataTable columns={columns} data={rows} searchable pageSize={10} />

Props

PropTypeDefaultDescription
columnsColumnDef<TData, any>[]TanStack React Table column definitions
dataTData[]Array of row data objects
pageSizenumber20Rows per page
searchablebooleanfalseEnable global search input
searchPlaceholderstring"Search..."Placeholder text for search
classNamestringAdditional CSS classes

Features

  • Sorting — Click column headers to sort ascending/descending
  • Pagination — Automatic page controls when data exceeds pageSize
  • Global Search — Filter rows across all columns
  • Custom Cells — Full control over cell rendering via TanStack column definitions
  • Tabular Numbers — Fixed-width numerals for aligned columns