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

@tanstack/react-charts

v0.14.0

Published

This compatibility package remains supported for existing applications. New applications use the React adapter from `@tanstack/charts/react`.

Readme

@tanstack/react-charts

This compatibility package remains supported for existing applications. New applications use the React adapter from @tanstack/charts/react.

Install Charts and the React peers:

pnpm add @tanstack/charts react react-dom
pnpm add -D @types/react @types/react-dom

Add granular d3-* modules and their matching type packages only when the chart needs scale or algorithm semantics outside the compact set.

import { defineChart } from '@tanstack/charts'
import { tooltip } from '@tanstack/charts/tooltip'
import { Chart } from '@tanstack/charts/react'

const interactiveDefinition = defineChart(definition, {
  svgAnimation: true,
  tooltip,
})

;<Chart
  definition={interactiveDefinition}
  aspectRatio={16 / 9}
  initialWidth={640}
  ariaLabel="Revenue by month"
  ariaDescription="Monthly revenue for the current fiscal year."
  onFocusChange={setFocusedPoint}
  onSelect={setSelectedPoint}
/>

The base Chart renders the core native tooltip without including React tooltip-body composition. Import the drop-in component from /tooltip only when passing renderTooltipBody:

import { Chart } from '@tanstack/charts/react/tooltip'

;<Chart
  definition={interactiveDefinition}
  ariaLabel="Revenue by month"
  renderTooltipBody={({ defaultBody, pinned, dismiss }) => (
    <>
      {defaultBody}
      {pinned ? <button onClick={dismiss}>Close</button> : null}
    </>
  )}
/>

Existing renderTooltipBody users should move their component import from @tanstack/charts/react to @tanstack/charts/react/tooltip. That entry also exports CanvasChart and RendererChart for the same opt-in with those renderers.

Switch only the import to opt into Canvas:

import { Chart } from '@tanstack/charts/react/canvas'

The default entry remains SVG-based. @tanstack/charts/react/core accepts an explicit renderer for application-owned surfaces, and neither optional path pulls Canvas into the default bundle.

The adapter server-renders the complete shared SVG. On the client, React owns only the outer host; the framework-neutral chart host owns measurement, reconciliation, animation, and interaction. Reuse the definition while its captured values are unchanged; a new definition updates the mounted surface without replacing it.

The definition drives all prop inference. Focus, group, selection, and render callbacks infer the original datum. Do not add adapter generics or cast adapter props; fix the definition, channel, or scale that TypeScript rejects.

Use height for a fixed-height chart or aspectRatio for proportional container sizing.

Read the installed @tanstack/charts/llms.txt documentation map, the published React Quick Start, or the React Adapter guide.

Licensed under MIT. Project credits are in the repository ACKNOWLEDGEMENTS.md.