Bklit UI charts and data visualization for any project using the @bklit shadcn registry. Install, compose, theme, and animate charts correctly. Triggers when working with @bklitui/ui/charts, @bklit components, data visualization, dashboards, or chart theming. Also invoke manually for chart tasks.
Install
npx skills add https://github.com/bklit/bklit-ui --skill bklit-uiBklit UI
Composable React chart components (visx + motion) distributed through the @bklit shadcn registry. shadcn add copies the source into the user's project — the user owns that code, and it is the source of truth for props.
Run the shadcn CLI with the project's package runner:
npx shadcn@latest,pnpm dlx shadcn@latest,bunx --bun shadcn@latest, oryarn dlx shadcn@latest.
Current Project Context
!`npx shadcn@latest info --json`
If the block above is empty or still shows the command (agents that do not expand ! injections), run npx shadcn@latest info --json yourself before writing code. Use it for framework, aliases (@/…), Tailwind version, and installed components.
- No
components.json? Runnpx shadcn@latest initfirst. - No
@bklitinregistries? Add"@bklit": "https://ui.bklit.com/r/{name}.json"(see installation.md), or install by URL:npx shadcn@latest add https://ui.bklit.com/r/line-chart.json.
Principles
- Install before inventing.
npx shadcn@latest add @bklit/<item>— never hand-roll SVG charts or reimplement a registry piece. - Import from the installed files, never from
@bklitui/ui/charts. That is a private monorepo package. Items install tocomponents/charts/<file>.tsx(undersrc/when the project uses it); import with the user's alias, e.g.@/components/charts/line-chart. See Imports. - Read the installed source. After
add, open the files incomponents/charts/to confirm prop names and defaults before using them. - Compose, don't flatten. Root chart →
Grid/Background→ series → axes → overlays →ChartTooltip. See composition.md. - Theme with tokens.
--chart-*variables andchartCssVars, not one-off hex values. See theming.md.
Imports
There is no barrel for component items — import each export from the file that defines it (paths relative to the components/charts/ alias):
| Import from | Exports |
|---|---|
line-chart |
LineChart, Line |
area-chart |
AreaChart, Area |
bar-chart / bar / bar-x-axis / bar-y-axis |
BarChart / Bar / BarXAxis / BarYAxis |
composed-chart / series-bar |
ComposedChart / SeriesBar (+ Line, Area from their charts) |
scatter-chart |
ScatterChart, Scatter |
candlestick-chart / candlestick |
CandlestickChart / Candlestick |
live-line-chart / live-line / live-x-axis / live-y-axis |
LiveLineChart / LiveLine / LiveXAxis / LiveYAxis |
pie-chart / pie-slice / pie-center |
PieChart / PieSlice / PieCenter |
ring-chart / ring / ring-center |
RingChart / Ring / RingCenter |
radar-chart, radar-grid, radar-axis, radar-labels, radar-area |
one component each |
gauge |
Gauge (installed by @bklit/gauge-chart) |
funnel-chart |
FunnelChart |
sunburst-chart, sunburst-segment, sunburst-center, sunburst (buildArcs) … |
sunburst parts |
heatmap · choropleth · sankey |
folder index.ts re-exports every part |
grid · x-axis · y-axis · background · reference-area · projection-line |
Grid · XAxis · YAxis · Background · ReferenceArea · ProjectionLine |
tooltip · legend · markers · patterns |
folder index.ts (ChartTooltip, Legend*, ChartMarkers, Pattern*) |
chart-context |
chartCssVars, useChart, TooltipData |
import { LineChart, Line } from "@/components/charts/line-chart";
import { Grid } from "@/components/charts/grid";
import { XAxis } from "@/components/charts/x-axis";
import { ChartTooltip } from "@/components/charts/tooltip";
import { chartCssVars } from "@/components/charts/chart-context";
Critical Rules
Composition → composition.md
- Series, axes, overlays, and
ChartTooltipare children of the root chart — they read chart context. - One root per chart. Mixed bars + lines on dates →
ComposedChartwithSeriesBar(notBar). Grid(orBackground) first so series paint above it.- Live charts use
LiveLine,LiveXAxis,LiveYAxis— notLine/XAxis. BarChartusesBarXAxis/BarYAxis(band scale), notXAxis.
Theming → theming.md
--chart-1…--chart-5for series;chartCssVars.linePrimaryetc. for semantic roles.- The registry adds missing
--chart-*tokens without overwriting the app's existing ones. - Override tokens in
:root/.dark; nodark:classes on chart SVG.
Tooltips → tooltips.md
ChartTooltipcontentreceives({ point, index });rowsreturns{ color, label, value }[].indicatorColoris a string or(point) => string.- Custom crosshairs/indicators use
useChart()— never global mouse listeners.
Overlays → overlays.md
ChartMarkersis a sibling ofChartTooltip; marker hover content goes insideChartTooltipchildren.ChartBrushhas no registry item — don't promise@bklit/brush.
Animation and loading → animation.md, loading.md
- Default enter: 1100ms, ease
cubic-bezier(0.85, 0, 0.15, 1); bars stagger across ~40% of that. - Replay with
revealSignatureor a newkey. status="loading"onLineChart/AreaChart/BarChart/HeatmapChart— one instance, no component swap.- Reduced motion is only partially handled internally — see animation.md.
Installation → installation.md
- Let
shadcn addinstall npm deps and@bklit/*registry dependencies; don't pin@visx/*by hand. - Don't install
*-exampleitems into an existing app — they writeapp/page.tsx.
Catalog
All items install with npx shadcn@latest add @bklit/<item>. For any <item>:
- Docs:
https://bklit.com/docs/components/<item>(add-ons live underhttps://bklit.com/docs/utility/…, e.g./tooltip,/legend,/axis/y-axis) - Gallery:
https://bklit.com/charts/<item>· Studio (tune props, copy code):https://bklit.com/studio?chart=<item> - Registry JSON:
https://ui.bklit.com/r/<item>.json
Charts
| Item | Use when |
|---|---|
line-chart |
Time series, multi-line trends, sparklines, markers, dashed tails |
area-chart |
Trends with filled regions, gradient/pattern fills, stat-card sparklines |
bar-chart |
Category comparisons; grouped, stacked, horizontal, square-column bars |
composed-chart |
Bars + lines/areas on one date axis, dual Y axes |
live-line-chart |
Streaming / real-time values ({ time: unixSeconds, value }) |
scatter-chart |
Point clouds over time, multiple series |
candlestick-chart |
OHLC financial data |
profit-loss-line |
One series crossing zero, colored by sign (studio slug too) |
pie-chart |
Part-to-whole slices, optional center stat |
ring-chart |
Concentric progress rings / donut KPIs |
radar-chart |
Multi-metric comparison across entities |
gauge-chart |
Single value 0–100, arc or linear notched track |
heatmap-chart |
Calendar / contribution grids, binned intensity |
funnel-chart |
Stage-to-stage conversion |
sankey-chart |
Flows between nodes |
sunburst-chart |
Hierarchical part-to-whole with drill-down |
choropleth-chart |
Geo regions colored by value (world/country maps) |
Add-ons (most install automatically as dependencies)
grid, x-axis, y-axis (not pulled in by line/area — add it for a value axis), chart-tooltip, legend, markers, background, patterns, reference-area, projection-line, bar-depth (3D/extruded bars on BarChart), chart-stat-flow (animated stat number used by pie/ring/gauge centers and stat cards). Internal plumbing items (chart-context, chart-animation, chart-series, chart-utils, chart-parent-size, utils, shimmering-text) come in automatically.
Brush: ChartBrush / ChartBrushLayout (docs: /docs/utility/brush) are not in any registry item today. If the user needs brush zoom, say so and point to the docs/source rather than inventing an install command.
Blocks (stat cards; browse at https://bklit.com/blocks)
| Item | What |
|---|---|
stat-card-area-01 |
Revenue card: gradient area sparkline, NumberFlow value, trend badge |
stat-card-line-01 |
Sessions card: line sparkline with overlaid value, trend badge |
stat-card-choropleth-01 |
Visitors card: choropleth sparkline map, trend badge |
Blocks need shadcn card + badge, write sample data under data/, and import from a @/components/charts barrel (components/charts/index.ts) that they create. Installing a second block overwrites that barrel and shared files (stat-card-chart.tsx, trend-badge.tsx) — merge them by hand.
Workflow
- Get project context (injection above or
npx shadcn@latest info --json); confirm@bklitis configured. - Pick the item from the catalog by the story the data tells; ask if unclear.
- Install:
npx shadcn@latest add @bklit/<item>(plus@bklit/y-axis,@bklit/legend, etc. if needed). - Read the installed source in
components/charts/(the files the CLI just wrote) — confirm exports, prop names, defaults, and data shape. Prefer it over memory or docs if they disagree. - Compose root → grid → series → axes → overlays → tooltip; import from the installed paths with the project alias.
- Theme with tokens; check light and dark.
- Point the user to the gallery / Studio URL for variants.
Quick Reference
npx shadcn@latest info --json
npx shadcn@latest add @bklit/line-chart @bklit/y-axis
npx shadcn@latest view @bklit/line-chart # inspect files before installing
"use client";
import { ChartTooltip } from "@/components/charts/tooltip";
import { Grid } from "@/components/charts/grid";
import { Line, LineChart } from "@/components/charts/line-chart";
import { XAxis } from "@/components/charts/x-axis";
const data = [
{ date: new Date("2025-01-01"), users: 1200, sessions: 1800 },
{ date: new Date("2025-02-01"), users: 1350, sessions: 1950 },
];
export function UsersChart() {
return (
<LineChart data={data}>
<Grid horizontal />
<Line dataKey="users" stroke="var(--chart-1)" />
<Line dataKey="sessions" stroke="var(--chart-2)" />
<XAxis />
<ChartTooltip />
</LineChart>
);
}
Related skills
- bklit-ui-design — design vocabulary and recipes: patterns and textures, squircle / rounded / 3D bars, edge fades, gradients, loading looks, and matching charts to the app's theme. Use it when the request is about how a chart looks.
- bklit-ui-migrate — move Recharts or shadcn
ChartContainer/ChartConfigcharts to Bklit equivalents.
Install all three with npx skills add bklit/bklit-ui.
References
- composition.md — structure, data shapes, multi-series
- theming.md — tokens,
chartCssVars, dark mode - tooltips.md —
ChartTooltipprops, custom content,useChart - overlays.md — legend, markers, reference area, projection, background, brush
- animation.md — enter timing, replay, live charts, reduced motion
- loading.md —
status, skeletons, loading labels - installation.md — registry setup, file layout, dependencies