TypeScript-First Charts
Chart.ts is not a JavaScript library with type definitions bolted on. It is built in TypeScript strict mode from the ground up. Every data shape is inferred, every prop is constrained, and your editor gives you autocomplete for everything.
$
npm install @chartts/coreexample.tsx
import { line } from "@chartts/core"
// TypeScript infers valid keys from your data
const svg = line({
data: [
{ month: "Jan", revenue: 4200, users: 120 },
{ month: "Feb", revenue: 5800, users: 180 },
],
x: "month", // TS: "month" | "revenue" | "users"
y: "revenue", // TS: "month" | "revenue" | "users"
// y: "invalid" // TS Error: not a key of data items
})
// Generic React component
<LineChart<SalesData>
data={salesData}
x="month" // autocomplete from SalesData keys
y="amount" // autocomplete from SalesData keys
/>Features
Built in TypeScript strict mode
Full type inference on data shapes
Generic components constrained to your types
Autocomplete for every prop and callback
Zero @types/ packages needed
Exported types for all chart options
Works with any TypeScript version 4.7+