Chart
shadcn's Recharts wrapper on Videorc's tokens. Series stay neutral unless their colour means something, and the tooltip floats on the popup glass.
Installation
$ pnpm dlx shadcn@latest add @videorc/chartUsage
import { Area, AreaChart } from "recharts";
import {
ChartContainer,
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart";
import type { ChartConfig } from "@/components/ui/chart";const config = {
kbps: { color: "var(--foreground)", label: "Bitrate (kbps)" },
} satisfies ChartConfig;
<ChartContainer className="aspect-auto h-56" config={config}>
<AreaChart data={data}>
<ChartTooltip content={<ChartTooltipContent />} />
<Area dataKey="kbps" fill="var(--color-kbps)" stroke="var(--color-kbps)" />
</AreaChart>
</ChartContainer>;Every key in the config becomes a --color-<key> variable on the chart, per theme. Point a mark's fill and stroke at it.
Anatomy
<ChartContainer config={config}>
<AreaChart>
<ChartTooltip content={<ChartTooltipContent />} />
<ChartLegend content={<ChartLegendContent />} />
</AreaChart>
</ChartContainer>Examples
Sparklines
A stats sparkline has no axes, no tooltip and no animation: the number above it is the reading. It's neutral by default and takes the warning tone only when the tile itself is a warning, with an icon beside its label so the colour is never alone.
Bars
One neutral series with its value at the tip of each bar. The platform names on the axis carry identity, so the bars need no colour of their own.
Theming
The theme has no --chart-* palette. Videorc's chrome is monochrome and colour carries meaning, so a chart colours its series from the tokens it already has:
| Colour | When |
|---|---|
var(--foreground), var(--muted-foreground) | Every series, by default |
var(--warning) | A reading that needs attention |
var(--destructive) | A failure |
glass-float | The tooltip: the popup glass with its rim and drop |
rounded-row | The tooltip's 8 px radius |
stroke-border, fill-muted-foreground | Grid lines, reference lines and axis text |
Give a series a theme instead of a color when it needs a different value in light and dark.
Accessibility
Recharts' accessibilityLayer (on by default) lets the keyboard move through a chart's points and opens the tooltip on each. A chart is never the only place its numbers live: say the current reading in words beside it, and mark a decorative sparkline aria-hidden.
API reference
ChartContainer
Every div prop, plus:
Prop
Type
ChartTooltipContent
Every Recharts Tooltip content prop, plus:
Prop
Type
ChartLegendContent
Prop
Type
ChartTooltip and ChartLegend are Recharts' Tooltip and Legend.
Chrome Row
The class names for the Stream Manager's chrome rows, the plate on the row that's on stream and the quieter one on a member's row, so a screen never names a chrome material itself.
Fader
audiocn's volume fader in decibels, restyled for Videorc. The range is the chrome fill and the thumb a chrome bead, with tapers, detents, a scale, reset and an editable value.