# Recharts — card for AI agents

Composable React component library for building responsive charts.

Category: Charts and data visualisation · npm package `recharts` · latest version 3.10.1 (checked 2026-11-01)
Install: `npm install recharts`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Recharts
- Install with `npm install recharts react-is` (or `deno add recharts react-is`), and keep `react-is` at the same version as the project's `react`.
- Build charts by nesting components such as `XAxis`, `YAxis`, `Tooltip`, `CartesianGrid`, `Legend` and `Line`/`Bar` inside a chart component like `LineChart` or `BarChart`.
- Set `dataKey` on axes and series to a field name present in the objects of the `data` array.
- For a chart that sizes to its container, follow the site example: pass `responsive` and a `style` with `width: '100%'` and an `aspectRatio`.
- For bars with positive and negative values, give each `Bar` the same `stackId` and set `stackOffset='sign'` on the chart.
- There is no title component: render titles as ordinary elements outside the chart. If axis labels run outside the container, increase the chart's `margin` prop.
- For a script-tag setup, load react, react-dom and react-is UMD builds before `Recharts.js`, then use `window.Recharts`.

## What it is
- Recharts is a chart library for React, built with React and D3. The README states its purpose as helping you "write charts in React applications without any pain." The GitHub repository was created on 2015-08-07 and is MIT licensed.
- You build a chart by nesting components rather than filling in one configuration object. In the README's example, a `LineChart` holds an `XAxis`, a `Tooltip`, a `CartesianGrid` and two `Line` elements, each pointed at a field with `dataKey`. The website says charts are "built on top of SVG elements with a lightweight dependency on D3 submodules."
- It is for developers drawing charts inside a React app. The README recommends npm, especially for single-page applications. It also lists Deno and a UMD build on unpkg that exposes the library as `window.Recharts`.

## Caveats
- No built-in chart title: Recharts has no title component. The author notes that many users find this frustrating, and suggests Flex or similar layout to center a title over the graph.
- Labels can push the chart past its margins: The author increased the chart's margins so everything fit inside the container. He says Recharts "seems to" have trouble with margin calculations once labels are involved.
- Making charts look good takes extra work: In the author's view, building graphs in Recharts is easy but making them beautiful is harder. His post walks step by step through building one real graph component.
- react-is has to match your React version: The install command adds `react-is` next to `recharts`. The README says its version must match your installed `react` package.

## Numbers (AgentGid data)
- Gid Score: 84.6 (#43 of all tools, 1 of 95 in its category)
- Used in 576 public projects set up for AI coding agents (9.2%)
- Downloads last week: 71,353,674 (as of 2026-11-24), +20.7% over 4 weeks
- GitHub stars: 27,741 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
Lucide React 92.7%, clsx 86.3%, Tailwind Merge 85.2%, Class Variance Authority 79.7%, React 99.0%, Tailwind CSS 96.5%

## Checked alternatives (same job)
- Chart.js: https://agentgid.com/tools/chart-js/agent.md
- D3.js: https://agentgid.com/tools/d3/agent.md
- Apache ECharts: https://agentgid.com/tools/echarts/agent.md
- ApexCharts: https://agentgid.com/tools/apexcharts/agent.md
- React ApexCharts: https://agentgid.com/tools/react-apexcharts/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/recharts/
- Homepage: https://github.com/recharts/recharts
- Repository: https://github.com/recharts/recharts
- Source: https://github.com/recharts/recharts#readme
- Source: https://github.com/recharts/recharts
- Source: https://github.com/recharts/recharts/releases
- Source: https://recharts.github.io

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
