uibrik

Ridgeline Chart

New

Preview

Customize

Rows7
Pitch38px
Overlap1.8
Accent

Usage

import { RidgelineChart } from "@/components/uibrik/ridgeline-chart/ridgeline-chart";

<RidgelineChart />

Installation

npx shadcn@latest add https://uibrik.com/r/ridgeline-chart.json
Adds the files to components/uibrik/ridgeline-chart and installs @number-flow/react, @tabler/icons-react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/ridgeline-chart.

Props

RidgelineChart
title
Type string
"Activity by hour"
Names what is plotted.
pitch
Type number
38
Distance between ridge baselines.
overlap
Type number
1.8
Peak height as a multiple of the pitch. Above 1 the ridges overlap.
accent
Type string
""
Highlight colour. Empty uses the chart palette.
rows
Type { key: string; label: string; values: number[] }[]
–
One ridge per row, drawn top to bottom.
labels
Type string[]
–
The x axis, one label per value.
format
Type Intl.NumberFormatOptions
{}
Formats every number.
onActiveChange
Type (index: number | null) => void
–
Called with the label index under the cursor.
className
Type string
–
Classes for the outer shell.