Pivot table
ProSummarise any records by the fields you choose: rows grouped one or two deep, a field across the columns, and the sum, average, count, minimum or maximum, with totals, sorting, shading and a grid you move through with the keyboard.
pnpm dlx shadcn@latest add @caliper/pivot-table| Region / Customer | 2025 Q4 | 2026 Q1 | 2026 Q2 | 2026 Q3 | Total |
|---|---|---|---|---|---|
| Benelux | €39,940 | €43,035 | €43,945 | €44,855 | €171,775 |
| DACH | €7,175 | €6,035 | €7,080 | €8,125 | €28,415 |
| Iberia | €45,695 | €47,650 | €49,605 | €53,745 | €196,695 |
| UK & Ireland | €51,565 | €53,520 | €55,475 | €59,615 | €220,175 |
| Total | €144,375 | €150,240 | €156,105 | €166,340 | €617,060 |
When to use #
Use it for
- Finance and sales reports where people ask the next question themselves.
- Admin tools over exported data.
Skip it when
- A fixed report everyone reads the same way; use a table or a chart.
Installation #
pnpm dlx shadcn@latest add @caliper/pivot-table
Adds its 8 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.
Usage #
Import it from your copy of the source. The example behind the preview comes with the source.
import { PivotTable } from "@/components/ui/pivot-table"
The worked example comes with Pro
The 34-line example behind the preview opens here with a Pro or Team licence.
API reference #
PivotTable
component
Accessibility #
It exposes group, grid and status semantics, with aria-label, aria-hidden, aria-describedby, aria-sort and aria-expanded kept in step with state. Changes that matter are announced through a live region.
Motion #
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.