Skip to content

Table

A table with 38px heads and 42px rows, and an embedded variant for tables inside a page.

For rows that are only read. variant="embedded" draws a small table inside a page with a border and taller rows. A table that is wider than its place scrolls sideways inside its own container, which then takes focus so the keyboard can scroll it. For sorting, editing or selection with keyboard movement between cells, use @khaeli/data-grid.

Default

ReleaseChannelMain changeShipped
4.2.0StableOffline drafts12 Nov 2026
4.1.2StableFaster search28 Oct 2026
4.3.0-beta.1BetaShared views20 Oct 2026
4.1.1StableExport to CSV6 Oct 2026
Invoices issued in November 2026
InvoiceProjectDueAmount
INV-1042Atlas redesign30 Nov 2026€4,800.00
INV-1041Billing migration24 Nov 2026€12,250.00
INV-1040Harbor mobile app15 Nov 2026€7,300.00
Total€24,350.00

Embedded

Action itemTeamDue
Confirm the launch dateProduct21 Nov
Review the pricing page copyMarketing24 Nov
Migrate the staging databasePlatform28 Nov

Selected rows

SelectTaskTitleStatus
T-318Write the migration guideIn review
T-317Add keyboard shortcuts to the editorIn progress
T-314Fix the export time zoneTo do

Installation

npx shadcn@latest add @khaeli/table

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

Registry items

Keyboard

Tab
Moves between the controls you put in the cells, such as a checkbox in each row. A table that fits its place takes no focus itself. While it is wider than its place, as on a phone, its scroll container is a tab stop too, with a focus ring inside its edge.
ArrowLeftArrowRight
With focus on the scroll container of a table that is wider than its place, scroll it sideways.
Space
Toggles a focused checkbox in a row.

Accessible name

  • Name the table with aria-label on Table, or with aria-labelledby pointing at the id of its TableCaption when a caption is shown.
  • While the table scrolls sideways, its container is a region with that same name, so a screen reader says what the focused area holds. A table with neither attribute still scrolls from the keyboard, but its container has no name.
  • TableHead is a th. A column whose head shows nothing, such as a column of checkboxes, still needs a name: put visually hidden text in it.
  • A control in a row is named after its row (Select T-318), since the same control repeats on every row.
  • A selected row is styled through data-state="selected". That is for the eye only: the checkbox carries the state.

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/table.json