Skip to content
caliper ui pro docs

Sortable table

A table with sortable columns, optional selection, loading and empty states.

Pro
Select rows to act on them
Projects
Atlas platformMara ChenActive$48,000
Harbour redesignNoor HaddadIn review$21,000
Release notesIvo PetrovActive$6,500
WayfinderSana OkaforPaused$33,000

Sorted by Project, ascending.

When to use

  • Records people need to sort and select.
  • Admin screens with bulk actions.

When not to use

  • Thousands of rows; use a virtual table.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/sortable-table

Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

SortableTable

13 props
PropTypeDefaultDescription
caption *string—
columns *readonly TableColumn<T>[]—
rows *readonly T[]—
getRowId *(row: T) => string—
sortSortState—
defaultSortSortStatenull
onSortChange((sort: SortState) => void)—
selectionreadonly string[]—Selected row ids. Provide with `onSelectionChange` to show checkboxes.
onSelectionChange((ids: string[]) => void)—
selectionActionsReactNode—
loadingboolean—
emptyLabelstring"No results."
classNamestring—

sortRows

0 props

No props of its own; it accepts the native props of its root element.

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It exposes status semantics, with aria-busy, aria-live, aria-label, aria-sort and aria-hidden kept in step with state. Changes that matter are announced through a live region.

Motion

  • State changes animate with the library's shared durations and curves, so its timing matches every other part.
  • Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/sortable-table.md

The index of every part is at /llms.txt.

More in Tables & trees