Skip to content
caliper ui docs

Pro

Ridgeline

Stacked distributions that overlap for easy comparison.

Pro
pnpm dlx shadcn@latest add @caliper/ridgeline

When the team edits

Edits by hour in the Halden workspace, October

Activity by weekday

Activity by weekday
PointMonTueWed
0:00111010
2:00131110
4:00191311
6:00311913
8:00443119
10:00504431
12:00445044
14:00314450
16:00193144
18:00131931
20:00111319
22:00101113
Installs components/ui/ridgeline.tsxDepends on d3-shapeMotion none in component source

When to use

Use it for

  • Comparing how several groups are distributed over the same axis.
  • Daily patterns across weekdays.

Skip it when

  • A single distribution; use a histogram.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/ridgeline

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.

example.tsx
import { Ridgeline } from "@/components/ui/ridgeline"

The worked example comes with Pro

The 29-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

Ridgeline

component
PropTypeDefaultDescription
label *string—
rows *readonly RidgeRow[]—
xLabels *readonly string[]—One label per sample, shared by every row.
unitstring""
formatValue((value: number) => string)numberText
loadingboolean—
errorstring—
classNamestring—

Accessibility

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

KeyBehaviour
↑Moves to the previous item or value.
↓Moves to the next item or value.
→Moves to the next item or value.
←Moves to the previous item or value.
PageUpMoves by a larger step, or to the previous page.
PageDownMoves by a larger step, or to the next page.
HomeJumps to the first item or the minimum.
EndJumps to the last item or the maximum.
EnterActivates the focused control.
SpaceActivates the focused control.
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.

All Distribution charts examples