Arc
ComponentsBlocksDocsPricingTry the demo
Get Pro
Introduction
Installation
Theming
Motion
AI and MCP
Changelog
Metrics dashboardPro
KPI drilldownPro
Metric explorerPro
Revenue explorerPro
MRR waterfallPro
Cohort retentionPro
Usage forecastPro
Journey flowPro
Uptime statusPro
Pivot builderNewPro
Choropleth explorerPro
Connected scatterPro
Horizon chartPro
Account healthPro
Market terminalPro
Budget variancePro
Small multiplesPro
Line replayPro
AI chatPro
AI composerPro
AI answerPro
Model pickerPro
Model arenaPro
Prompt studioPro
Document extractionPro
Agent memoryPro
AI side panelPro
AI inline editPro
Research runPro
AI insight cardPro
Catch upPro
AI feature launchPro
AI search barPro
AI setup wizardPro
Call insightsPro
Lead scoringPro
Agent runPro
Agent tasksPro
Agent approvalsPro
Agent routinesPro
Agent orchestratorPro
MCP serversPro
Knowledge basePro
Eval suitePro
Agent builderPro
Agent galleryPro
SidebarPro4
Page header
Command palette
Notification center
Selection toolbarPro
Empty states
Search resultsPro
Login and sign up5, free and Pro variants
Onboarding illustrationPro
OTP input
Multi-step formPro
Two-factor setupPro
Magic linkPro
Settings pagePro
Settings commandPro
Security settingsPro
Billing overviewPro
Usage billingPro
Cancel flowPro
Onboarding surveyPro
Spend alertPro
Team membersPro
Invite peoplePro
Team directoryPro
Roles and permissionsPro
Profile pagePro
API keysPro
WebhooksPro
IntegrationsPro
Environment variablesPro
Domain verifyPro
Webhook testerPro
Plan comparison
Pricing calculatorPro
Usage pricingPro
Cart drawerPro
Checkout summaryPro
Live checkoutPro
Seat managerPro
Credit top-upPro
Invoice studioPro
Wallet cardPro
Delivery trackerPro
Product listingPro
Product detailPro
Seat mapPro
Activity feedPro
Inbox triagePro
Support conversationPro
Support widgetPro
Help centerPro
Feature votingPro
File upload
Media playerPro
Week calendarPro
Availability pickerPro
Project boardPro
Gantt timelineNewPro
Release readinessPro
Kanban boardPro
Feedback boardPro
Smart schedulerPro
Task breakdownPro
Goal trackerPro
Hero section
Hero signupPro
Scroll storyPro
Spotlight gridPro
Feature bentoPro
Comparison table
Logo marquee
Studio perspectivesPro
Stats band
Changelog feed
FAQ section
Contact section
Team showcasePro
Blog grid
Site header
Site footer
CTA section
Newsletter signup
Activity terrainPro
Revenue globePro
Customer galaxyPro
Semantic zoomPro
Layout morphPro
Exploded viewPro
What’s new4 new
BlocksPivot builder

Pivot builder

Pro

A pivot table builder where you drag dimensions and measures into Rows, Columns, Values and Filters wells, with a live preview while you hover, per value aggregation, subtotals, a grand total, heat shading, collapsible row groups, swap and CSV export.

Live block · sample data

When to use

  • Self-serve analysis where the viewer picks the rows, columns and measures.
  • Internal reporting screens that replace a spreadsheet pivot table.
  • Exploring a flat export before deciding which fixed chart or report to build.

When not to use

  • Use data-grid or sortable-data-table to browse, edit or select individual records; the pivot only shows aggregates.
  • Use tree-table for a hierarchy that already exists in the data, such as folders or an org chart.
  • Use cohort-retention or metric-explorer when the question is fixed and a chart answers it faster.

Installation

Pro source and install commands unlock with a Pro plan.

Usage

Render <PivotBuilder /> for the Ridgeline Coffee demo, or pass records, fields (dimensions and measures) and a defaultLayout of { filters, columns, rows, values } chips. Use onLayoutChange to save views and fileName to name the export.

example.tsx
1import { PivotBuilder, type PivotField } from "@/components/arc/blocks/pivot-builder/pivot-builder";2 3const fields: PivotField[] = [4  { id: "team", label: "Team", kind: "dimension" },5  { id: "month", label: "Month", kind: "dimension", values: ["Jan", "Feb", "Mar"] },6  { id: "hours", label: "Hours", kind: "measure", format: "number", aggs: ["sum", "average", "percent"] },7];8 9export function TimeReport({ rows }: { rows: { team: string; month: string; hours: number }[] }) {10  return (11    <PivotBuilder12      title="Logged hours"13      description="Q1 2026, all teams"14      records={rows}15      fields={fields}16      defaultLayout={{17        filters: [],18        columns: [{ id: "c-month", field: "month" }],19        rows: [{ id: "r-team", field: "team" }],20        values: [{ id: "v-hours", field: "hours", agg: "sum", heat: true }],21      }}22      fileName="logged-hours.csv"23      onLayoutChange={layout => saveView(layout)}24    />25  );26}
Built fromButtonEmpty state

API reference

2 parts. The first is the root.

PivotBuilder

A pivot table builder. Drag dimensions and measures from the field list into Rows, Columns, Values and Filters, and the pivot recomputes as you hover, with subtotals, a grand total, per value aggregation, heat shading, row groups that expand and collapse, a swap for rows and columns, and CSV export.

PropTypeDefaultDescription
recordsPivotRecord[]pivotOrdersFlat records to aggregate, one object per row keyed by field id. Defaults to 1,184 Ridgeline Coffee orders from 2025, generated from a fixed seed.
fieldsPivotField[]pivotFieldsFields in the list: { id, label, kind: "dimension" | "measure", values?, format?, aggs? }. values sets the display order of a dimension; format is currency, number, percent or text; aggs lists the aggregations a measure offers, first is the default.
defaultLayoutPivotLayoutstarterLayoutLanes the pivot opens with: { filters, columns, rows, values }, each a list of { id, field, agg?, heat? }. Pass empty lists to open on the empty state.
defaultExclusionsPivotExclusions{}Values hidden by the filters lane, keyed by field id, such as { channel: ["Retail"] }. Only fields placed in Filters apply.
titlestring"Sales pivot"Heading of the screen.
descriptionstring"Ridgeline Coffee orders, January to December 2025"Line under the heading. Pass an empty string to hide it.
fileNamestring"ridgeline-sales-pivot.csv"Name of the file Export CSV downloads.
onLayoutChange(layout: PivotLayout) => void–Called after every committed change to the lanes, an aggregation or heat shading. Hover previews during a drag do not call it.
classNamestring–Class on the root element.

Aggregations

Set per value chip from its menu. The same measure can sit in Values twice with different aggregations.

PropTypeDefaultDescription
sumAgg–Adds the measure across the records in a cell.
averageAgg–Mean of the measure across the records in a cell.
countAgg–Number of records in a cell.
distinctAgg–Number of different values, such as unique customers. Offered for text measures.
percentAgg–Share of the filtered grand total, shown as % of total. Text measures use the share of records.

Keyboard interactions

EnterorSpace on a field
Opens the field menu: add a dimension to rows, columns or filters, or add a measure to values with a chosen aggregation.
EnterorSpace on a chip
Opens the chip menu: aggregation and heat shading for values, shown values for filters, move, reorder and remove.
Alt+Arrow leftorArrow right
Moves the focused chip one place within its well.
DeleteorBackspace
Removes the focused chip from the pivot.
Arrow keys in a menu, Escape
Move through menu items and close the menu, returning focus to the chip.
EnterorSpace on a row group
Expands or collapses that group. The corner button expands or collapses all groups.

Accessibility

  • The result is a table with role="table", row, rowheader, columnheader and cell roles, and aria-colspan on grouped column headers, so screen readers read each value with its row and column.
  • Every drag has a menu path: fields and chips are real buttons with menus, so the whole pivot can be built without a pointer.
  • Row groups are buttons with aria-expanded. The scroll area is focusable and named, so keyboard users can scroll wide pivots.
  • Changes are announced in a polite live region, such as "Country moved to columns" or "Exported ridgeline-sales-pivot.csv".
  • Heat shading is never the only signal: every shaded cell prints its value, and the footer names the shaded measure with a low to high key.
  • Pointer focus draws no ring; keyboard focus shows Arc's shared focus ring. Keyboard position shows as a filled chip, field or row header.

Motion

  • The dragged chip follows the pointer on motion values, with no React render per frame. React only hears when the target well or insert position changes.
  • Chips in the wells glide aside to open a dashed slot where the chip will land, on the smooth spring with no overshoot. On release the chip flies into that slot, or home if nothing changed, or fades out when dropped outside to remove.
  • The table previews the drop while you hover: a new structure crossfades in, rows that appear or leave slide the rest into place, and a changed number rises into its cell.
  • Group chevrons rotate on the spring token, heat shading fades by opacity, and the swap icon turns half a turn per swap.
  • Reduced motion removes the fly, lift and slide; chips and rows land at once and numbers change in place.

Responsive behavior

  • From 880px the field list sits beside the wells as a column; below it becomes wrapped field pills above the wells.
  • Wells sit in a two by two grid from 640px and stack below it, with the well name above its chips on phones.
  • The table scrolls inside its card with the header row and first column pinned, and the grand total pinned to the bottom.
  • On touch screens chips, fields, row groups and menu items grow to 44px. A tap opens the menu; a drag moves the chip.

Performance

  • The pivot recomputes in one pass per layout change and memoizes on layout and filters; 1,200 records with nested rows and columns compute in well under a frame.
  • Drag hit testing reads layout offsets, not animated rects, so the insert position never oscillates while neighbours move.
  • Row and cell animations use transform and opacity only. Very large pivots (hundreds of rows) stay correct but should collapse groups by default.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Choose it when people need to slice one flat dataset their own way: sales by region and quarter, hours by team and month, tickets by queue and priority.
  • Feed records as flat objects keyed by field id. Give dimensions an explicit values order when the natural order is not alphabetical (quarters, months, sizes).
  • Start with a meaningful defaultLayout so the first view already answers a question. Use the empty layout only where building from scratch is the point.
  • Persist views with onLayoutChange and pass the saved layout back as defaultLayout with a key to restore it.
  • The engine is synchronous and client side. Aggregate on the server first for datasets beyond tens of thousands of records.
/components/blocks/pivot-builder/markdown

The full library index for assistants is at /llms.txt.

Related

Data gridProComponentA spreadsheet grid with range selection, inline editing, a fill handle, and animated sorting.Tree tableComponentA table with nested rows, tri-state selection, hierarchy-preserving sort, and lazy-loaded children.Cohort retentionProBlockA cohort retention triangle that morphs into retention curves and rewashes by segment.Metric explorerProBlockKPI cards that open into a scrubbable chart and morph between metrics and ranges.Sortable data tableComponentCompare structured records with sortable columns.
PreviousHero signupNextSearch results
Arc · 134 block pagesllms.txt

On this page

  • Preview
  • When to use
  • When not to use
  • Installation
  • Usage
  • API reference
  • Keyboard
  • Accessibility
  • Motion
  • Responsive behavior
  • Performance
  • Notes for AI
  • Related
View as Markdown

Sales pivot

Ridgeline Coffee orders, January to December 2025

Dimensions

Measures

Drag a field into a well, or press Enter on it to place it.

Filters
Columns
Rows
Values
Region / Country
Q1 2025
Q2 2025
Q3 2025
Q4 2025
Total
$274,777
$302,249
$375,710
$388,174
$1,340,910
United States
$167,968
$196,664
$240,740
$270,425
$875,797
Canada
$50,738
$59,015
$90,801
$68,412
$268,966
Mexico
$21,409
$27,199
$29,477
$20,496
$98,581
Brazil
$34,662
$19,371
$14,692
$28,841
$97,566
$122,460
$188,276
$175,389
$237,801
$723,926
Germany
$65,067
$46,280
$71,287
$57,275
$239,909
United Kingdom
$33,274
$93,895
$47,706
$106,614
$281,489
France
$7,790
$38,275
$46,259
$34,126
$126,450
Netherlands
$16,329
$9,826
$10,137
$39,786
$76,078
$43,472
$74,884
$52,225
$83,316
$253,897
Japan
$19,529
$32,247
$11,528
$18,876
$82,180
Australia
$21,540
$39,207
$35,010
$55,316
$151,073
Singapore
$2,403
$3,430
$5,687
$9,124
$20,644
Grand total
$440,709
$565,409
$603,324
$709,291
$2,318,733
1,184 ordersRevenueLowHigh