Skip to content
Aback UI

Table

Semantic table primitives for dense data.

StableUsed in Aback LaunchRegistry JSON (opens in a new tab)
Invoices for the Pro plan, in USD.
InvoiceDateAmountStatus
INV-0011 Sep 2026$120.00Paid
INV-0021 Oct 2026$120.00Paid
INV-0031 Nov 2026$120.00Open

Installation

Copy the source with the CLI to own and edit it, or import it from the npm package.

npx aback-ui@latest add table

Writes components/ui/table.tsx. First time in this project? Run npx aback-ui@latest init first, as the installation guide shows.

Usage

Import the parts you need from the installed file. The Code tab above has a complete, working example.

tsx
import {
  Table,
  TableHeader,
  TableBody,
  TableFooter,
  TableRow,
  TableHead,
  TableCell,
  TableCaption,
} from "@/components/ui/table";

API reference

Props and composition points for Table. Native element props pass through.

PropTypeDefaultDescription
TableCaptioncomponentNoneA visible caption that also names the table for assistive technology.
TableHead scope"col" | "row""col"Set to row for a table whose first cell in each row is a header.
containerPropsReact.ComponentProps<'div'>NoneProps for the scroll container. Pass an aria-label to name a horizontally scrollable region.
classNamestringNoneColumn width and alignment adjustments.

Dependencies: no extra packages, plus the shared @/lib/utils helper.

Accessibility

Semantics, keyboard behavior, and the decisions that keep the component operable.

  • Use a caption or a nearby heading to name the table. A table without a name is hard to navigate.
  • Keep header cells in thead and set scope row when the first column identifies each row.
  • The scroll container is keyboard focusable so wide tables can be scrolled without a pointer.
  • Do not use table layout for page structure. Use CSS grid or flex instead.
  • Numbers belong in tabular-nums cells and should be right aligned with their header.

Used in production

The Aback products whose interfaces shaped this component.