Dashral Pro is on the wayGet 30% off at launch

Dashral

Data Table

A full-featured table built on TanStack Table v9: search, faceted filters, sorting, column visibility, row selection, pagination and CSV or Excel export.

$ pnpm dlx shadcn@latest add https://dashral.com/r/data-table.json
Status
olivia@example.comSuccess$316
budi@example.comSuccess$242
liam@example.comProcessing$837
ayu@example.comSuccess$874
noah@example.comFailed$721

6 rows

Rows per page
Page 1 of 2

Installation

$ pnpm dlx shadcn@latest add https://dashral.com/r/data-table.json

Adds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:

components.json
{
  "registries": {
    "@dashral": "https://dashral.com/r/{name}.json"
  }
}

Then add components by name:

$ pnpm dlx shadcn@latest add @dashral/data-table

Usage

example.tsx
import { createDataTableColumnHelper, DataTable } from "@/components/dashral/data-table"

type Customer = { name: string; email: string; plan: string }

const helper = createDataTableColumnHelper<Customer>()
const columns = helper.columns([
  helper.accessor("name", { header: "Name" }),
  helper.accessor("email", { header: "Email" }),
  helper.accessor("plan", { header: "Plan" }),
])

<DataTable columns={columns} data={customers} getRowId={(row) => row.email} exportable />

Examples

Filters, selection, actions and export

Faceted filters need filterFn: "oneOf" on the column. The toolbar prop receives the table for bulk actions. exportable adds a CSV and Excel menu.

ProductStatus
INV-1048

Olivia Martin

olivia@example.com

Pro License2026-10-07Paid
$249.00
INV-1047

Jackson Lee

jackson@example.com

Team License2026-10-07Pending
$129.00
INV-1046

Isabella Nguyen

isabella@example.com

Personal License2026-10-06Paid
$49.00
INV-1045

William Kim

will@example.com

Team License2026-10-06Refunded
$129.00
INV-1044

Sofia Davis

sofia@example.com

Personal License2026-10-05Paid
$49.00
INV-1043

Budi Santoso

budi@example.com

Pro License2026-10-05Failed
$249.00
INV-1042

Ayu Lestari

ayu@example.com

Personal License2026-10-04Paid
$49.00
INV-1041

Liam Johnson

liam@example.com

Team License2026-10-04Paid
$129.00
INV-1040

Emma Wilson

emma@example.com

Pro License2026-10-03Pending
$249.00
INV-1039

Rizky Pratama

rizky@example.com

Personal License2026-10-03Paid
$49.00

12 rows

Rows per page
Page 1 of 2

API reference

DataTable

PropTypeDefault
columnsDataTableColumnDef<TData>[]

From createDataTableColumnHelper<TData>(). Required.

—
dataTData[]

The rows. Required.

—
getRowId(row: TData) => string

A stable id, so selection survives sorting and paging.

—
searchPlaceholderstring

The global search field.

"Search..."
filters{ column; title; options }[]

Faceted filters; their columns need filterFn: "oneOf".

[]
pageSizesnumber[]

Rows per page choices; the first is the default.

[10, 20, 50]
toolbar(table) => ReactNode

Extra toolbar content, e.g. bulk actions.

—
exportableboolean | { filename?, formats?, columns?, extraColumns? }

An Export menu (CSV, Excel .xlsx) for the rows the search and filters leave, across pages, or the selected ones, with the visible columns. columns: per column id, { label, value(row) } or false; extraColumns: [{ label, value(row) }] only in the file. The file is named filename-YYYY-MM-DD.

false
emptyMessagestring

Shown when nothing matches.

"No results."

DataTableColumnHeader

PropTypeDefault
column / title

A sortable header button.

—

dataTableSelectColumn()

A checkbox column for selecting rows.

Keyboard

KeysAction
TabMove through search, filters, headers, row checkboxes and paging
EnterorSpaceSort by a header, toggle a checkbox

Accessibility

  • A real <table>; sortable headers carry aria-sort and say what clicking does.
  • Checkboxes are labelled (“Select row”, “Select all rows on this page”).