npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-echarts-kit

v1.0.7

Published

Production-ready React components for Apache ECharts with TypeScript support, SSR compatibility, and comprehensive theming

Readme

React ECharts Kit

Production-ready React charting library built on Apache ECharts with TypeScript support, SSR compatibility, and comprehensive theming.

npm version npm downloads License: MIT

Installation

npm install react-echarts-kit
# or
yarn add react-echarts-kit
# or
pnpm add react-echarts-kit

Quick Start

import { BarChart, ThemeProvider } from 'react-echarts-kit';

const data = {
  categories: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
  series: [
    {
      name: 'Sales',
      data: [120, 200, 150, 80, 70],
      color: '#5470c6',
    },
  ],
};

function App() {
  return (
    <ThemeProvider defaultTheme="light">
      <BarChart data={data} width="100%" height={400} />
    </ThemeProvider>
  );
}

Features

  • TypeScript First - Full type safety and IntelliSense support
  • SSR Safe - Works with Next.js 16+ and other SSR frameworks
  • Light/Dark Themes - Built-in theme system with customization
  • Responsive - Automatic resizing with ResizeObserver
  • Tree Shakeable - Import only what you need
  • Multiple Chart Types - Bar, Line, Pie, Area, and Gauge charts

Chart Types

BarChart

import { BarChart } from 'react-echarts-kit';

<BarChart
  data={data}
  width="100%"
  height={400}
  horizontal={false}
  stack={false}
/>

LineChart

import { LineChart } from 'react-echarts-kit';

<LineChart 
  data={data} 
  width="100%" 
  height={400} 
  smooth={true} 
  area={false} 
/>

PieChart

import { PieChart } from 'react-echarts-kit';

<PieChart
  data={data}
  width="100%"
  height={400}
  donut={false}
  showLabels={true}
/>

AreaChart

import { AreaChart } from 'react-echarts-kit';

<AreaChart 
  data={data} 
  width="100%" 
  height={400} 
  stack={true} 
  smooth={true} 
/>

GaugeChart

import { GaugeChart } from 'react-echarts-kit';

<GaugeChart
  data={{ value: 75, min: 0, max: 100, title: 'Progress', unit: '%' }}
  width="100%"
  height={400}
/>

Theming

import { ThemeProvider, useTheme } from 'react-echarts-kit';

function ThemeToggle() {
  const { theme, setTheme } = useTheme();

  return (
    <button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>
      Toggle Theme
    </button>
  );
}

function App() {
  return (
    <ThemeProvider defaultTheme="dark">
      <ThemeToggle />
      <BarChart data={data} />
    </ThemeProvider>
  );
}

SSR Support (Next.js)

Components work automatically with Next.js:

import { BarChart, LineChart } from 'react-echarts-kit';

export default function Dashboard() {
  return (
    <div>
      <BarChart data={barData} />
      <LineChart data={lineData} />
    </div>
  );
}

For explicit SSR-safe imports:

import { BarChart, LineChart } from 'react-echarts-kit/ssr';

Hooks

useChartData

import { useChartData, BarChart } from 'react-echarts-kit';

function Chart() {
  const { data, setData, isLoading, setLoading } = useChartData(initialData);

  return <BarChart data={data} />;
}

useChartTheme

import { useChartTheme } from 'react-echarts-kit';

function Chart() {
  const { theme, themeConfig, isDark, toggleTheme } = useChartTheme();

  return <div>Current theme: {theme}</div>;
}

useResponsiveChart

import { useResponsiveChart, LineChart } from 'react-echarts-kit';

function Chart() {
  const { containerRef, dimensions } = useResponsiveChart({
    width: '100%',
    height: 400,
  });

  return (
    <div ref={containerRef}>
      <LineChart data={data} width={dimensions.width} height={dimensions.height} />
    </div>
  );
}

API Reference

Common Props

All chart components accept these props:

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | ChartData | Required | Chart data | | width | number \| string | "100%" | Chart width | | height | number \| string | 400 | Chart height | | theme | "light" \| "dark" \| "custom" | "light" | Chart theme | | options | EChartsOption | {} | Custom ECharts options | | onEvents | Record<string, Function> | - | Event handlers |

Data Formats

Simple Data:

const data = [
  { name: 'A', value: 100 },
  { name: 'B', value: 200 },
];

Multi-Series Data:

const data = {
  categories: ['Jan', 'Feb', 'Mar'],
  series: [
    { name: 'Sales', data: [120, 200, 150] },
    { name: 'Profit', data: [20, 50, 30] },
  ],
};

Advanced Usage

Event Handling

<BarChart
  data={data}
  onEvents={{
    click: (params) => console.log('Clicked:', params),
    mouseover: (params) => console.log('Hover:', params),
  }}
/>

Custom ECharts Options

<BarChart
  data={data}
  options={{
    title: { text: 'Custom Title', left: 'center' },
    grid: { left: '10%', right: '10%' },
  }}
/>

TypeScript

Full TypeScript support with exported types:

import type {
  BaseChartProps,
  BarChartData,
  LineChartData,
  PieChartData,
  ThemeType,
  ThemeConfig,
} from 'react-echarts-kit';

Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+

License

MIT © Daniel Lawal

Links