caliper uidocs

Icicle chart

Pro

A hierarchy as stacked rows, each block as wide as its share. Choose a block to zoom; it widens and its descendants spread beneath it. Escape steps out.

Installs components/ui/icicle-chart.tsxDepends on d3-shape, lucide-reactMotion none in component source
pnpm dlx shadcn@latest add @caliper/icicle-chart
Cloud spend, September ($k)

Choose a block to zoom in. Escape or the path above zooms out.

Cloud spend, September ($k)
PathValue
Cloud spend268
Cloud spend › Production195
Cloud spend › Production › Compute131
Cloud spend › Production › Compute › Web42
Cloud spend › Production › Compute › Workers28
Cloud spend › Production › Compute › GPU61
Cloud spend › Production › Databases47
Cloud spend › Production › Databases › Postgres38
Cloud spend › Production › Databases › Redis9
Cloud spend › Production › Network17
Cloud spend › Staging20
Cloud spend › Staging › Compute14
Cloud spend › Staging › Databases6
Cloud spend › Data53
Cloud spend › Data › Warehouse33
Cloud spend › Data › Pipelines12
Cloud spend › Data › Storage8

When to use #

Use it for

  • Cloud spend by account, service and resource.
  • Bundle size by package, or headcount by org.

Skip it when

  • Flat categories; use the bar chart.
  • Hierarchies deeper than five levels at once.

Installation #

terminal
pnpm dlx shadcn@latest add @caliper/icicle-chart

Adds its 3 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. It is built from icicleTotal and IcicleChart.

example.tsx
import { icicleTotal, IcicleChart } from "@/components/ui/icicle-chart"

The worked example comes with Pro

The 20-line example behind the preview opens here with a Pro or Team licence.

Checking your licence…

API reference #

icicleTotal

component
PropTypeDefault
id *string—
label *string—
valuenumber—
childrenreadonly IcicleNode[]—

IcicleChart

component
PropTypeDefaultDescription
label *string—
root *IcicleNode—
unitstring""
formatValue((value: number) => string)numberText
levelsnumber4How many rows to show below the focused block.
loadingboolean—
errorstring—
classNamestring—

Accessibility #

It is built on native elements and keeps aria-label, aria-busy, aria-hidden and aria-current in step with state.

KeyBehaviour
EscapeCloses or cancels, then returns focus to where it came from.

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.