Docs
Getting started
Install @kamod-ch/charts and render your first Preact-native chart.
Installation
Install the package with your workspace package manager:
pnpm add @kamod-ch/charts preactImport theme tokens once in your app entry:
import "@kamod-ch/charts/theme.css";
preact is a peer dependency. React, react-dom, and preact/compat are not supported.
Quick start
High-level charts accept typed row data plus a series configuration:
tsx
import { LineChart } from "@kamod-ch/charts/line";
import "@kamod-ch/charts/theme.css";
const data = [
{ month: "Jan", revenue: 28400 },
{ month: "Feb", revenue: 31200 },
{ month: "Mar", revenue: 36800 },
];
export function RevenueChart() {
return (
<LineChart
data={data}
xKey="month"
xScale="point"
series={[{ key: "revenue", label: "Revenue", color: "var(--chart-1)" }]}
height={240}
initialWidth={640}
responsive
showGrid
tooltip
title="Monthly revenue"
/>
);
}Next steps
- Browse the chart gallery
- Tune props in the playground
- Read accessibility, motion, and theming foundations