When to use
- Read-only lists of records with several fields each: invoices, accounts, team members, deploys.
- Data-heavy views where rows need to stay compact (
dense, 36px rows) or easy to scan (comfortable, 48px rows). - Long lists inside a bounded panel, where the header should stay pinned while the body scrolls.
When not to use
- A short list of items with one or two fields: a plain list or Card rows read better.
- Layout. Tables are for tabular data only.
Installation
pnpm dlx shadcn add https://eased.dev/r/table.jsonnpx shadcn add https://eased.dev/r/table.jsonyarn dlx shadcn add https://eased.dev/r/table.jsonbunx --bun shadcn add https://eased.dev/r/table.jsonThe command adds Table, everything it builds on and Eased’s tokens to your project.
Install the dependencies
pnpm add @tanstack/react-tablenpm install @tanstack/react-tableyarn add @tanstack/react-tablebun add @tanstack/react-tableAdd the Eased pieces it builds on
Copy each item’s files the same way, or install them with the CLI:
Copy the source into your project
components/eased/table/table.tsxTSX "use client";import { useTable, type RowData } from "@tanstack/react-table";import type { CSSProperties, ReactNode } from "react";import { easedFeatures, TableView, type EasedColumnDef, type TableDensity } from "../_primitives/table-core/table-core";export { easedColumns, type EasedColumnDef, type EasedColumnMeta, type TableDensity } from "../_primitives/table-core/table-core";export type TableProps<TData extends RowData> = { /** Rows. Keep the array stable (state or a memo): a new array every render rebuilds the row model. */ data: ReadonlyArray<TData>; /** TanStack column definitions, made with `easedColumns<TData>()`. Keep them at module scope or memoised. */ columns: ReadonlyArray<EasedColumnDef<TData>>; /** A stable id per row. Defaults to the row index. */ getRowId?: (row: TData, index: number) => string; /** The table's accessible name (a visually hidden caption). */ label: string; /** `dense` (36px rows, default) or `comfortable` (48px rows). */ density?: TableDensity; /** Pin the header while the body scrolls. Default true; bound the table's height for it to apply. */ stickyHeader?: boolean; /** Shown when `data` is empty. */ empty?: ReactNode; className?: string; style?: CSSProperties;};/** * A premium hairline table on TanStack Table: half-pixel row rules, a sentence-case muted * header, tabular numbers right-aligned on one edge, one emphasised cell per row, and two * densities. Columns are plain TanStack column defs; cells can come from the Cells kit. */export function Table<TData extends RowData>({ data, columns, getRowId, label, density = "dense", stickyHeader = true, empty, className, style,}: TableProps<TData>) { const table = useTable({ features: easedFeatures, data: data as TData[], columns, getRowId, enableSorting: false }); return ( <TableView table={table} label={label} density={density} stickyHeader={stickyHeader} empty={empty} className={className} style={style} /> );}Keep the folder layout
The files import each other by relative path (
../lib/motion), so keep each one at the path shown, undercomponents/eased/.
Usage
import { PersonCell, StatusCell } from "@/components/eased/cells/cells";import { easedColumns, Table } from "@/components/eased/table/table";type Invoice = { id: string; customer: string; status: string; amount: number };const money = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" });const col = easedColumns<Invoice>();const columns = col.columns([ col.accessor("customer", { header: "Customer", cell: (c) => <PersonCell name={c.getValue()} />, meta: { emphasis: true, grow: true } }), col.accessor("status", { header: "Status", cell: (c) => <StatusCell tone="success">{c.getValue()}</StatusCell> }), col.accessor("amount", { header: "Amount", cell: (c) => money.format(c.getValue()), meta: { align: "end" } }),]);export function InvoicesTable({ invoices }: { invoices: Invoice[] }) { return <Table label="Invoices" data={invoices} columns={columns} getRowId={(r) => r.id} className="min-h-0 flex-1" />;}Examples
Comfortable rows
48px rows and 14px text, for tables people scan rather than work through. Cells from the Cells kit size themselves to match: a bigger avatar and a second line in PersonCell.
<Table label="Team" data={members} columns={columns} density="comfortable" />Columns that drop out when narrow
A column's className goes on its header and every cell, so a container query can hide it in a narrow panel.
col.accessor("issued", { header: "Issued", cell: (c) => <RelativeTimeCell date={c.getValue()} />, meta: { align: "end", className: "@max-[26rem]:hidden" },});API reference
Table
| Prop | Type | Default | Description |
|---|---|---|---|
data | ReadonlyArray<T> | Rows. Keep the array stable (state or a memo): a new array every render rebuilds the row model. | |
columns | ReadonlyArray<EasedColumnDef<T>> | From easedColumns<T>(), at module scope or memoised. | |
getRowId | (row: T, index: number) => string | the row index | A stable id per row. |
label | string | The table's accessible name, rendered as a visually hidden caption. | |
density | "dense" | "comfortable" | "dense" | 36px rows with 13px text, or 48px rows with 14px text. |
stickyHeader | boolean | true | Pin the header while the body scrolls. Give the table a bounded height for it to apply. |
empty | ReactNode | "Nothing here yet" | Shown in place of rows when data is empty. |
className | string | On the scroll container. | |
style | CSSProperties | On the scroll container. |
The table scrolls inside its own container, which feathers any edge with more content beyond it. Sorting is off. easedColumns, EasedColumnDef, EasedColumnMeta and TableDensity are re-exported from the same file.
Column meta
| Key | Type | Default | Description |
|---|---|---|---|
align | "start" | "end" | "start" | end right-aligns the header and cells and sets tabular numbers. Use it for every numeric column. |
emphasis | boolean | The one emphasised cell per row (usually the name): full-strength text at weight 500. The rest read secondary. | |
grow | boolean | This column takes the leftover space and truncates when the table is narrow, instead of forcing a horizontal scroll. Give it to one text column. | |
width | string | A width hint, e.g. "7rem" or "40%". | |
className | string | Classes for the column's header and cells, e.g. "@max-md:hidden". |
The first and last columns are padded by the parent's --pad (16px when unset), so they line up with the edges of the panel around the table.
Accessibility
- A semantic
<table>with a hidden<caption>fromlabel, andscope="col"on every header. - Row hover is a background change only; nothing in a row depends on hover to be reachable.
Motion
It stays still on purpose. Hover lights a row with no transition, so moving the pointer down a column never leaves a trail, and density changes snap instead of animating height. The cells carry the motion.
Notes for AI
Use Table for read-only tabular data, with columns built from easedColumns<T>() and cells from the Cells kit. Set align: "end" on every numeric column, emphasis and grow on the one name column, and give the table a bounded height (min-h-0 flex-1 in a flex column) when the header should stay pinned.
Do not build columns inline in the render (keep them at module scope or memoised), and do not pass a new data array every render. Do not add borders to cells or rows: the hairlines are already drawn as inset shadows that never change a row's size.
Related components
- Data Table Cells: person, status, delta, progress, time and ID cells for its columns.
- Clickable Card: for a handful of records shown as blocks rather than rows.
- Sortable Data Table