Adapters

React, Vue, Svelte, Astro, Solid, Qwik, Angular, and vanilla DOM take the same spec. Adapters do not add a second chart API.

spec.json200 · valid

Open the playground to edit a spec with validate, repair, and export.

Where to read

The Show code for menu picks React, Vue, Svelte, Astro, Solid, Qwik, Angular, or JS. /docs/react, /docs/solid, and the other stack URLs open Overview with that framework selected.

Other hosts

Preact aliases react and react-dom to preact/compat, then uses @chartkitdev/react. Next.js App Router and Remix or React Router use that same component. Nuxt uses @chartkitdev/vue. SvelteKit uses @chartkitdev/svelte and already includes the SVG during SSR. htmx and Eleventy print renderToString from @chartkitdev/vanilla. When an htmx swap should take pointers, use <chart-kit> from @chartkitdev/element, or call mount().

resolve: { alias: { react: "preact/compat", "react-dom": "preact/compat", },
}
import { renderToString } from "react-dom/server";
import { Chart } from "@chartkitdev/react"; const html = renderToString(<Chart spec={spec} />);
import { renderToString } from "@chartkitdev/vue/ssr"; const html = await renderToString(spec);
<script> import { Chart } from "@chartkitdev/svelte";
</script> <Chart {spec} />
import { renderToString } from "@chartkitdev/vanilla"; const svg = renderToString(spec);
eleventyConfig.addShortcode("chart", (spec) => renderToString(spec));