uibrik

Area Chart

New

Preview

Customize

number
Series2
Accent

Usage

import { AreaChart } from "@/components/uibrik/area-chart/area-chart";

<AreaChart />

Installation

npx shadcn@latest add https://uibrik.com/r/area-chart.json
Adds the files to components/uibrik/area-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/area-chart.

Props

AreaChart
title
Type string
"Visitors"
Names what is plotted.
format
Type Intl.NumberFormatOptions
{}
Formats every number, e.g. { style: "currency", currency: "USD" }.
accent
Type string
""
First series colour. Empty uses the chart palette.
data
Type ({ label: string } & Record<string, number>)[]
–
One row per period, oldest first, with a value per series key.
series
Type { key: string; label: string; color?: string }[]
–
The series to draw, 1 to 5.
previous
Type number[]
–
The first series over the previous period, drawn dashed for comparison.
headline
Type "total" | "latest"
"total"
Headline is the period's sum or its latest value.
showGrid
Type boolean
true
Grid lines with value labels.
height
Type number
220
Plot height in px.
onActiveChange
Type (index: number | null) => void
–
Called with the row under the cursor.
className
Type string
–
Classes for the outer shell.