AdaptTable for Tailwind

Accessible Tailwind data table

Tab into the grid and the arrows move a visible focus, one cell at a time. Home and End jump to the row's edges.

Every move, sort, filter and edit is announced through a live region — the part of a table a sighted reader cannot check, so this page repeats those announcements as text as they happen.

columnSelectionCheckbox puts a named checkbox on each header so a column can be selected without a modifier key a touchscreen does not have. The grid and the checkboxes are Tailwind.

The grid is semantic markup carrying the map's classes; the header checkbox is a native input, and the focus ring is yours to dress — nothing in the map singles the active cell out.

The code

import { DataTable } from "@adapttable/unstyled";

export function People({ rows, columns }) {
  return (
    <DataTable
      data={rows}
      columns={columns}
      rowKey={(row) => row.id}
      cellNavigation
      columnSelectionCheckbox
    />
  );
}

Install

pnpm add @adapttable/unstyled @adapttable/core

The same feature in the other kits

More Tailwind features

Reference: accessibility, cell-navigation. More of this kit: AdaptTable for Tailwind, or the live demo.