Skip to content
Back to search

microcharts

Word-sized charts for React, made for LLMs and humans — 106 chart types, zero runtime dependencies, accessible by default, RSC-safe.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/ganapativs/microcharts with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/ganapativs/microcharts'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ganapativs--microcharts/badge.svg)](/listings/ganapativs--microcharts)

HTML

<a href="/listings/ganapativs--microcharts"><img src="/api/listings/ganapativs--microcharts/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

npm install @microcharts/react

Import the stylesheet **once** at the root of your app — it carries every theming token and chart style in a low-specificity cascade layer, so your own styles always win:

// app/layout.tsx
import "@microcharts/react/styles.css";

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 214 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. <img src="assets/promo.png" alt="microcharts — word-sized charts for React, made for AI first and for the people reading what it writes. 106 chart types, zero dependencies, ~2–7 kB interactive · ~1–4 kB static." width="920">
  3. # @microcharts/react
  4. **Word-sized charts for React** — zero runtime dependencies, ~2–7&nbsp;kB interactive · ~1–4&nbsp;kB static, accessible
  5. by default, and server-component safe.
  6. <br>
  7. [![npm](https://img.shields.io/npm/v/@microcharts/react?color=2f52d4&label=npm)](https://www.npmjs.com/package/@microcharts/react)
  8. [![gzip per chart](https://img.shields.io/badge/per_chart-~2–7_live_·_~1–4_static_kB-2f52d4)](https://microcharts.dev/docs/performance)
  9. [![zero dependencies](https://img.shields.io/badge/dependencies-0-077353)](https://microcharts.dev)
  10. [![types](https://img.shields.io/npm/types/@microcharts/react?color=2f52d4)](https://microcharts.dev)
  11. [![React 18 · 19](https://img.shields.io/badge/React-18_·_19-077353)](https://microcharts.dev/docs/quickstart)
  12. [![MIT](https://img.shields.io/npm/l/@microcharts/react?color=666)](./LICENSE)
  13. [![Reviewed with Argos](https://argos-ci.com/badge.svg)](https://argos-ci.com?utm_source=ganapativs/microcharts&utm_campaign=oss)
  14. **[Docs](https://microcharts.dev)** · **[Gallery](https://microcharts.dev/docs/charts)** ·
  15. **[Quickstart](https://microcharts.dev/docs/quickstart)** · **[AI usage](https://microcharts.dev/docs/ai)** ·
  16. **[llms.txt](https://microcharts.dev/llms.txt)**
  17. </div>
  18. ---
  19. microcharts is **106 tiny, handcrafted chart types** built to sit _inside_ an interface: a sentence, a table cell, a KPI
  20. card, a tab header, a streamed AI reply. The grammar is small enough for a model to emit correctly mid-sentence, and
  21. every chart describes itself in words, so a chart an LLM streams into a chat reply is one a person can read and check.
  22. > **Status:** tested and in production use, but not across every stack and edge yet. If you hit something, open an issue
  23. > on [GitHub](https://github.com/ganapativs/microcharts/issues).
  24. ## Why
  25. - **AI-native.** A chart is plain `data` plus a generated sentence. One grammar across all 106 types — a model that has
  26. seen one chart can write them all. → [AI usage](https://microcharts.dev/docs/ai)
  27. - **Zero dependencies.** No chart engine, no D3 — just SVG. React is the only peer. CI-enforced, forever.
  28. - **Server-component safe.** Static charts are hook-free and render to HTML with **zero client JavaScript**.
  29. Interactivity is a separate opt-in `/interactive` import.
  30. - **Accessible by default.** Every chart is an `img` with a natural-language summary built from your data; it updates
  31. when the numbers do. → [Accessibility](https://microcharts.dev/docs/accessibility)
  32. - **Tiny.** **~2–7 kB interactive · ~1–4 kB static** gzip per chart, budget-gated in CI. Every type has one documented,
  33. honest encoding channel and a stated precision.
  34. - **Motion, opt-in.** Interactive charts draw on with `animate` plus one `import "@microcharts/react/motion"`, and glide
  35. continuous marks when data updates. Entrances respect `prefers-reduced-motion` and never replay over server-rendered
  36. HTML. → [Motion](https://microcharts.dev/docs/motion)
  37. ## Install
  38. ```bash
  39. npm install @microcharts/react
  40. ```
  41. Import the stylesheet **once** at the root of your app — it carries every theming token and chart style in a
  42. low-specificity cascade layer, so your own styles always win:
  43. ```tsx
  44. // app/layout.tsx
  45. import "@microcharts/react/styles.css";
  46. ```
  47. ## Your first chart
  48. Every chart renders from `data` alone. This works in a **React Server Component** with zero client JavaScript — pure
  49. SVG, and its accessible name is generated from the data.
  50. ```tsx
  51. import { Sparkline } from "@microcharts/react/sparkline";
  52. <Sparkline data={[3, 5, 4, 8, 6, 9]} title="Weekly revenue" />;
  53. ```
  54. Each chart imports from its **own subpath**, so you only ship what you use. Every chart follows the same two-entry
  55. pattern: a static default, and an `/interactive` twin.
  56. ## Add interactivity
  57. Need hover, keyboard navigation, touch, or live announcements? Import the same chart from `/interactive`. The rendered
  58. output and the accessible name are identical, because the interactive entry composes its static twin. It only **adds**
  59. props; you opt into the client component where it matters.
  60. ```tsx
  61. import { Sparkline } from "@microcharts/react/sparkline/interactive";
  62. <Sparkline data={[3, 5, 4, 8, 6, 9]} title="Weekly revenue" />;
  63. ```
  64. Every interactive chart shares one contract, so you learn it once. Hover or arrow keys make a unit **active**; a click,
  65. tap, <kbd>Enter</kbd>, or <kbd>Space</kbd> **selects** it and pins the readout so it survives blur; <kbd>Escape</kbd> or
  66. a press outside the chart clears; <kbd>Home</kbd>/<kbd>End</kbd> jump to the ends. Read it back with `onActive` and
  67. `onSelect` — payload `{ index, value, label?, formatted? }`, where `value` is the raw number and `formatted` is the
  68. chart's ready-to-display string — and control the pin with `selectedIndex` / `defaultSelectedIndex`. Set
  69. `readout={false}` to hide the in-chart value chip and render `datum.formatted` wherever you like. Single-unit scalar
  70. charts (Delta, Progress, StatusDot, Bullet, …) take `onSelect` alone.
  71. ```tsx
  72. <Sparkline data={[3, 5, 4, 8, 6, 9]} onActive={(d) => setHovered(d?.value ?? null)} onSelect={(d) => pin(d)} />
  73. ```
  74. ## Annotate with children
  75. Thresholds, markers, and target zones are **children** — the same grammar on every chart that supports them:
  76. ```tsx
  77. import { Sparkline } from "@microcharts/react/sparkline";
  78. import { Threshold, Marker } from "@microcharts/react/annotations";
  79. <Sparkline data={[120, 180, 240, 210, 260]} title="Latency p95">
  80. <Threshold y={200} label="SLO" />
  81. <Marker x={2} celebrate />
  82. </Sparkline>;
  83. ```
  84. ## Theme it
  85. About two dozen `--mc-*` CSS custom properties are the runtime contract; presets are token bundles. Set one on a subtree
  86. with the provider — presets are visual only and never change what the data means:
  87. ```tsx
  88. import { MicroProvider } from "@microcharts/react";
  89. <MicroProvider theme="editorial">
  90. <Sparkline data={[3, 5, 4, 8, 6, 9]} />
  91. </MicroProvider>;
  92. ```
  93. Presets: `modern` (default), `editorial`, `mono`, `vivid`, plus output-context `print` and `eink`. Dark mode is
  94. hand-tuned, not inverted. For a whole brand theme, `defineTheme` (from `@microcharts/react/theme`) derives a matched,
  95. color-blind-safe palette and dark twins from one accent:
  96. ```tsx
  97. import { defineTheme } from "@microcharts/react/theme";
  98. const brand = defineTheme({ accent: "#6d28d9" });
  99. <MicroProvider style={brand.style}>…</MicroProvider>;
  100. ```
  101. Retune density with one scalar (`--mc-density`), give figures their own face (`--mc-font-numeric`), or recolor a single
  102. categorical chart with a `colors` array. → [Theming guide](https://microcharts.dev/docs/theming)
  103. ## The catalog
  104. **106 stable chart types** — 34 core, 26 decision, 23 expressive, 23 frontier — grouped by the _question_ each one
  105. answers. `data` alone always renders something correct, and a prop name means the same thing on every chart (`domain`,
  106. `color`, `title`, `summary`, `label`, `format`…), so picking a chart is picking the question you need answered.
  107. Sparklines, bars, deltas, and bullets through bump charts, funnels, honeycombs, calendar strips, and confidence bands —
  108. **[browse them all in the live gallery →](https://microcharts.dev/docs/charts)**
  109. > **Not shipping, on purpose:** pie, needle-gauge/speedometer, battery, waffle, violin. Each fails at micro scale or on
  110. > the honest-encoding bar, and each has an in-catalog replacement (Bullet for gauges, SegmentedBar for pie, MicroBox for
  111. > violin). → [what to use instead](https://microcharts.dev/llms.txt)
  112. ## Made for models
  113. A model writes the chart; a person reads it. The docs site publishes machine surfaces alongside the human ones:
  114. | Surface | What it is |
  115. | --------------------------------------------------------- | --------------------------------------------------- |
  116. | [`/llms.txt`](https://microcharts.dev/llms.txt) | Curated map of the catalog and guides |
  117. | [`/llms-full.txt`](https://microcharts.dev/llms-full.txt) | The complete generated docs corpus |
  118. | [`/catalog.json`](https://microcharts.dev/catalog.json) | Every chart's name, import path, props, data shapes |
  119. ## The MCP server
  120. The surfaces above are for reading. [`@microcharts/mcp`](https://www.npmjs.com/package/@microcharts/mcp) lets an
  121. assistant call the library directly: a Model Context Protocol server that runs on your machine over stdio, with three
  122. tools backed by this library — **find** the chart type that answers a question, **get** its exact props and a
  123. ready-to-render sample, and **render** it to a self-contained SVG with the generated alt text attached.
  124. ```json
  125. {
  126. "mcpServers": {
  127. "microcharts": {
  128. "command": "npx",
  129. "args": ["-y", "@microcharts/mcp"]
  130. }
  131. }
  132. }
  133. ```
  134. Works in Claude Desktop, Claude Code, Cursor, and VS Code; nothing is hosted and no key is involved. The same three
  135. capabilities ship as Vercel AI SDK tools on the `@microcharts/mcp/ai-sdk` subpath. Full reference:
  136. [microcharts.dev/docs/mcp](https://microcharts.dev/docs/mcp). Also listed in the
  137. [Glama MCP registry](https://glama.ai/mcp/servers/ganapativs/microcharts).
  138. ## Compatibility
  139. React **18 and 19**. ESM-only, per-component subpath exports, types-first export conditions. Static charts render in any
  140. RSC or SSR setup with no client runtime.
  141. `sideEffects` is a two-entry allowlist, never `false`: `styles.css` and the opt-in `./motion` engine are both imported
  142. for their side effects, and `false` would let a bundler drop them. Every other module is side-effect free and
  143. tree-shakes normally, and since charts ship as per-component subpaths, you only pay for the ones you import.
  144. ## Contributing
  145. ```bash
  146. pnpm install
  147. pnpm check # typecheck + lint + format + test + knip
  148. pnpm size # gzip budgets (needs a build first)
  149. pnpm build
  150. ```
  151. Bug fixes and fixes to existing charts are the most useful thing to send. New props and new chart types are open but
  152. held to a high bar — the catalog is already broad at 106 types, so a new one needs a question the others can't answer.
  153. Either way, open an issue and wait for a yes before you open a PR. [CONTRIBUTING.md](./CONTRIBUTING.md) has the policy,
  154. the CI gates, and what a good bug report contains.
  155. ## License
  156. [MIT](./LICENSE) © [Ganapati V S](https://meetguns.com)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.