Skip to content
caliper ui pro docs

Data cube

Three dimensions in one object: region by product by quarter. Pick which dimension is depth, step through its layers, and read the layer you are on as an ordinary table beside it, with the peak in bold.

Pro
Revenue, Quarter Q3: Region by Product, in thousands of dollars
Q3FreeTeamProEnterprise
EMEA68k93k46k71k
AMER58k83k108k133k (peak)
APAC76k101k54k79k
LATAM44k69k94k119k

Layer 3 of 4 · Quarter Q3 · Region by Product · peak 133k

When to use

  • Data that really has three dimensions and people switch which one they slice by.
  • Showing that a table is one slice of something larger.

When not to use

  • Two dimensions; use a heatmap or a pivot table.
  • Reading exact values from the picture. The table is for that.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/data-cube

Adds its 7 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

DataCube

16 props
PropTypeDefaultDescription
labelstring"Values"What the numbers are, for the table caption, for example "Revenue".
dimensions *readonly [DataCubeDimension, DataCubeDimension, DataCubeDimension]—Exactly three dimensions.
values *readonly (readonly (readonly number[])[])[]—
depthstring—The id of the dimension drawn as depth. Controlled when set.
defaultDepthstring—
onDepthChange((dimensionId: string) => void)—
layernumber—The chosen layer along the depth dimension. Controlled when set.
defaultLayernumber0
onLayerChange((layer: number) => void)—
format((value: number) => string)(n: number) => n.toLocaleString("en-US")How a number is written in the table and the readout.
unitstring—Said once in the table caption, for example "in thousands of dollars".
statusDepthStatus"ready"
messagesDepthMessages—
onRetry(() => void)—
disabledboolean—
classNamestring—

Keyboard

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

Accessibility

It is built on native elements and keeps aria-hidden, aria-label, aria-valuetext and aria-live in step with state. Changes that matter are announced through a live region.

Notes for AI

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

/docs/components/data-cube.md

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

More in Showpiece charts