Ridgeline
Stacked distributions that overlap for easy comparison.
| Point | Mon | Tue | Wed |
|---|---|---|---|
| 0:00 | 11 | 10 | 10 |
| 2:00 | 13 | 11 | 10 |
| 4:00 | 19 | 13 | 11 |
| 6:00 | 31 | 19 | 13 |
| 8:00 | 44 | 31 | 19 |
| 10:00 | 50 | 44 | 31 |
| 12:00 | 44 | 50 | 44 |
| 14:00 | 31 | 44 | 50 |
| 16:00 | 19 | 31 | 44 |
| 18:00 | 13 | 19 | 31 |
| 20:00 | 11 | 13 | 19 |
| 22:00 | 10 | 11 | 13 |
When to use
- Comparing how several groups are distributed over the same axis.
- Daily patterns across weekdays.
When not to use
- A single distribution; use a histogram.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/ridgeline
Adds its 5 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
Ridgeline
8 props
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—
Keyboard
- ↑
- 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.
- PageUp
- Moves by a larger step, or to the previous page.
- PageDown
- Moves by a larger step, or to the next page.
- Home
- Jumps to the first item or the minimum.
- End
- Jumps to the last item or the maximum.
- Enter
- Activates the focused control.
- Space
- Activates the focused control.
- Escape
- Closes or cancels, then returns focus to where it came from.
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.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/ridgeline.mdThe index of every part is at /llms.txt.