Charcoal UI

Data Table

A complete data table: column sorting, search, row selection with a bulk-action bar that slides in, pagination, and rows that animate into their new order.

  • Category: Charts
  • Licence: Charcoal UI Pro
  • Built with: React 19, Tailwind CSS 4, Motion
  • Dependencies: motion, clsx, tailwind-merge

Examples

Data Table

API reference

PropTypeDefaultDescription
columns{ key; header; render?; sortable?; align?; width? }[]—
rowsT[]—Each row needs an id.
pageSizenumber8
searchablebooleantrue
selectablebooleantrue
bulkActions(selected: T[]) => ReactNode—

About Data Table

Data Table gives you sortable columns, search, row selection with a bulk-action bar that slides in, and pagination, with rows that animate into their new order when you sort or filter.

Data Table is an animated chart for React 19, styled with Tailwind CSS 4 and animated with Motion. It drops into Next.js, Vite, Remix or Astro through the shadcn CLI as a single file you own.

When to use Data Table

  • Admin panels and back offices.
  • Customer and order lists.
  • User management.
  • Any list that outgrows a plain table.

How it works

It is a real table element, with aria-sort on sorted headers and labelled checkboxes. Search filters across the columns you mark, and row reordering uses Motion layout, so changes are easy to follow.

Each chart has a text alternative, hover tooltips are mirrored by keyboard focus where data points are interactive, and colour is never the only way a value is shown. With prefers-reduced-motion on, it holds still or settles instantly instead of animating.

Customizing Data Table

Every prop is documented in the API reference above with its type and default. The ones you will reach for first are listed here.

The Customize panel next to the preview lets you change pageSize, selectable live, and the Code tab updates to match, so the snippet you copy already carries your values.

  • columns.
  • rows (T[]): Each row needs an id.
  • pageSize (number, default 8).
  • searchable (boolean, default true).
  • selectable (boolean, default true).
  • bulkActions ((selected: T[]) => ReactNode).

Goes well with Data Table

These charts pieces share its tokens and motion language, so they sit together on one page without clashing.

  • Donut Chart: An animated React donut chart: segments draw in and thicken on hover
  • Activity Heatmap: A React contribution heatmap with four shades, tooltips and keyboard navigation
  • Sparkline: An animated React sparkline with fill, trend colour and a pulsing end dot
  • Line Chart: An animated React line chart with a snapping crosshair and multi-series tooltips
  • Area Chart: An animated React area chart with a comparison series and a target line

Install Data Table

npx shadcn@latest add @charcoal/data-table

Data Table is part of Charcoal UI Pro. One seat unlocks all 393 Pro components, 112 landing-page sections and 100 full templates, for every personal and client project, with updates included. Add the @charcoal registry once with your access token, then the command above copies data-table.tsx into components/ui and installs clsx, tailwind-merge.

You own the file you install: no runtime package, no lock-in, nothing to keep in sync. Change it however your product needs.

See Charcoal UI Pro pricing · Pro setup

Frequently asked questions

How do I install Data Table?
Data Table is part of Charcoal UI Pro. Add the @charcoal registry to components.json with your access token, then run npx shadcn@latest add @charcoal/data-table. It copies data-table.tsx into components/ui and installs motion, clsx, tailwind-merge.
Is Data Table free for commercial use?
Data Table needs a Charcoal UI Pro seat, monthly or a one-time lifetime price. A seat covers unlimited personal and commercial projects, including client work, and every future Pro component.
Does Data Table work with Next.js?
Yes. It is a client component for React 19 styled with Tailwind CSS 4, so it works in the Next.js App Router and Pages Router, Vite, Remix and Astro.
Can an AI coding agent install Data Table?
Yes. Connect the Charcoal UI MCP server (https://charcoalui.com/mcp) to Claude Code, Cursor or any MCP client; get_component returns Data Table's props and get_install_command returns the exact command.

Data Table as Markdown · llms.txt