DEV Community

Moe Salehy
Moe Salehy

Posted on

I drew 125 React charts by hand in SVG. No D3, no Recharts.

Every dashboard I built started the same way: install a chart library, fight its defaults, then override half of its styles to make it match the rest of the app.

So I wrote the charts myself. Klar is 125 React chart components, each one drawn directly in SVG. There is no chart library underneath: no D3, no Recharts.

It is free, MIT licensed, and the code is here: github.com/klar-run/klar
Candlestick with volume
Kaplan–Meier survival

What is in it

  • 83 charts that take data through props, plus 42 more pulled from 12 complete example dashboards
  • Everyday charts: line, bar, pie, waterfall
  • Finance: candlestick, order book, drawdown
  • Science and statistics: Kaplan-Meier, heatmaps, PCA biplots
  • Business intelligence: control charts, bullet charts, Marimekko
  • Engineering: flame graphs, Sankey, network graphs

Every chart has light and dark themes, works from the keyboard, and exports to SVG, PNG, and CSV.

Why plain SVG

A chart is rectangles, paths, and text. When the component is just React and SVG, you can read it top to bottom, change anything, and nothing is hidden behind a config object.

It also keeps the dependency list short: clsx, tailwind-merge, lucide-react, and the Inter font.

Three ways to use it

1. Install from npm

npm i klar-charts
⭐ Must Read: salehy/i drew react charts by hand in svg no d no recharts gg - ประเด็นร้อน ⭐ Must Read: salehy/i drew react charts by hand in svg no d no recharts gg - ประเด็นร้อน
import 'klar-charts/styles.css'
import { ThemeScope, LineChart } from 'klar-charts'

export function RevenueCard() {
  return (
    <ThemeScope>
      {/* pass your data props here */}
      <LineChart />
    </ThemeScope>
  )
}
⭐ Must Read: salehy/i drew react charts by hand in svg no d no recharts gg - ประเด็นร้อน ⭐ Must Read: salehy/i drew react charts by hand in svg no d no recharts gg - ประเด็นร้อน

Flame graph
Volatility surface
The stylesheet is precompiled, so you do not need Tailwind, and it never resets your page. Theme tokens live inside ThemeScope, so your existing shadcn/ui theme stays untouched.

2. Copy the source with the shadcn CLI

If you would rather own the code than depend on a package:

npx shadcn@latest add https://klar.run/r/fin-candlestick.json
⭐ Must Read: salehy/i drew react charts by hand in svg no d no recharts gg - ประเด็นร้อน ⭐ Must Read: salehy/i drew react charts by hand in svg no d no recharts gg - ประเด็นร้อน

3. Let your AI assistant pick the chart

Klar ships an MCP server, so an assistant like Claude can choose a chart and wire it up for you:

claude mcp add klar -- npx -y klar-mcp
⭐ Must Read: salehy/i drew react charts by hand in svg no d no recharts gg - ประเด็นร้อน ⭐ Must Read: salehy/i drew react charts by hand in svg no d no recharts gg - ประเด็นร้อน

The example dashboards

The 12 dashboards show the charts working together on real layouts: Orbit (sprint capacity), Lumen Clinic (consult conversion), Sentinel (service health), Synapse (LLM operations), and more.

Browse all of them at klar.run/charts.
Sankey diagram
Raincloud plot

Try it and tell me what is missing

If Klar saves you an afternoon, a star on GitHub helps other developers find it, and it tells me which direction to keep building in.

Which chart should I draw next? Tell me in the comments and I will add the most requested one.

Top comments (0)