@devstool/shadcn-echarts started from a personal need: getting Apache ECharts breadth with a modern, minimal shadcn/ui look without rebuilding setup from scratch.
Maintained by @noobships under the devstool brand.
- Official website: https://shadcn-echarts.devstool.dev
- Live demo app: https://shadcn-echarts-demo.devstool.dev/dashboard
- npm package: https://www.npmjs.com/package/@devstool/shadcn-echarts
- Demo repository: https://github.com/noobships/shadcn-echarts-demo
- Issues: https://github.com/noobships/shadcn-echarts/issues
- shadcn-style chart components that feel native in modern dashboards
- Automatic dark/light mode behavior
- Minimal defaults that do not fight your own explicit styles
- Tree-shakeable exports to keep bundle size clean
- Multiple installation paths: npm package, shadcn registry, or manual ownership
pnpm add @devstool/shadcn-echarts echarts reactnpx shadcn@latest add https://shadcn-echarts.devstool.dev/r/bar-chart.jsonAdd this to your components.json:
{
"registries": {
"@devstool": "https://shadcn-echarts.devstool.dev/r/{name}.json"
}
}Then run:
npx shadcn@latest add @devstool/bar-chartCopy files from registry/default/* into your project, then modify as needed.
import { BarChart } from "@devstool/shadcn-echarts";
export function MyChart() {
return (
<BarChart
option={{
xAxis: { type: "category", data: ["Mon", "Tue", "Wed"] },
yAxis: { type: "value" },
series: [{ type: "bar", data: [150, 230, 224] }],
}}
height={320}
/>
);
}Charts now animate on initial mount by default:
animateOnMount(defaulttrue)animateOnMountDelayMs(default16)
Disable if you want raw immediate rendering:
<BarChart option={option} animateOnMount={false} />If you pass deeply customized option trees with CSS-token-like colors, you can pre-resolve them:
import { resolveOptionColorTokens } from "@devstool/shadcn-echarts/themes";
const safeOption = resolveOptionColorTokens(option);- 2D charts work out of the box with
echarts. - 3D/WebGL charts are supported, but require the
echarts-glplugin. - Browsers already provide WebGL. You do not install WebGL directly.
- 3D support is currently early and not yet battle-tested across many real-world apps.
pnpm add echarts-glImport echarts-gl once in a client entry (for example, your app provider or client layout wrapper):
'use client'
import 'echarts-gl'- Node.js 18+
- pnpm 9+
pnpm install# Build library once
pnpm build
# Watch-mode library build
pnpm dev
# Type checks
pnpm type-check
# Lint
pnpm lint
pnpm lint:fix# Build and verify shadcn registry assets
pnpm registry:build
pnpm registry:verify
# Run docs website (apps/www)
pnpm www:dev
pnpm www:buildpnpm -C demo devsrc/ # Core chart components, hooks, themes, presets
registry/ # shadcn registry source files
apps/www/ # Public docs/registry website
demo/ # Standalone demo app + visual tests
docs/ # Internal docs (style, presets, theming, release)
scripts/ # Build and verification scripts- Index:
https://shadcn-echarts.devstool.dev/registry.json - Item format:
https://shadcn-echarts.devstool.dev/r/<component>.json
Contributions are welcome. Start here: CONTRIBUTING.md.
Open an issue: https://github.com/noobships/shadcn-echarts/issues
MIT License. See LICENSE.