Best chart library for a Next.js SaaS dashboard
Chart libraries · Checked 21 November 2026
Short answer
For a Next.js SaaS dashboard that already uses shadcn/ui, use the shadcn chart component. It is Recharts in a client file, colored with your Tailwind CSS variables. Data Lighthouse takes a narrower path. The traffic card calls Recharts directly. The revenue chart is a small SVG in the overview file.
MRR and ARR are cards, not a line over time. The overview does not compute churn. See the live demo, the pricing page, and the SaaS metrics template.
- License
- $59 once
- Refund
- 7-day no-questions refund
- Stack
- Next.js 16, shadcn/ui, Recharts, Postgres, Drizzle, Clerk, optional Stripe
Which chart library fits a Next.js SaaS dashboard?
Use shadcn charts when the dashboard already uses shadcn/ui. Use Recharts alone when you will set colors yourself. That second path is the one in this repository.
Pick Tremor when you want a dashboard kit and you accept its license and React peer. Pick Nivo for a finished specialized chart. Pick Chart.js when the chart must be canvas. Pick Apache ECharts when one option object must cover canvas or SVG. Pick visx when the mark is custom and you will compose the SVG.
The check date for the registries and docs below is 21 November 2026. npm latest tags move. This page does not publish a measured bundle size.
How do these chart libraries compare?
Read one row for the drawing surface, the App Router boundary, dark mode, the license, and the fit. The sections under the table hold the source for each cell.
| Library | Draws with | App Router | Dark mode | License | Best fit |
|---|---|---|---|---|---|
| Recharts | SVG | Client file | You pass colors | MIT | Compose a chart in React |
| shadcn/ui charts | SVG, via Recharts | Client file | CSS variables | MIT, copied in | App already uses shadcn/ui |
| Tremor | SVG, via Recharts | Client file | Tailwind on the kit | Apache-2.0 | Dashboard kit, mind the React peer |
| Nivo | SVG, HTML, or canvas | Client file if it measures | Theme guide | MIT | A finished specialized chart |
| Chart.js | Canvas | Client file | Colors in options | MIT | Canvas and an existing Chart.js setup |
| Apache ECharts | Canvas default, SVG optional | Client file | Theme object | Apache-2.0 | Large series or one option object |
| visx | SVG you compose | Client file if it measures | Classes on your SVG | MIT | A custom mark you compose |
What does Recharts give a React dashboard?
Recharts draws SVG. The README calls that native SVG support and shows a LineChart made of axes, a grid, and lines. The GitHub license is MIT. Copyright on that file runs 2015-2026.
- Client file.
ResponsiveContainermeasures the parent in the browser. Put"use client"on the first line of the file that imports it. A server page can pass a plain array of points. - Declared dependencies. npm
lateston the check date was 3.11.0. That package.json lists Redux Toolkit, Immer, and victory-vendor among its dependencies. This page does not measure the client chunk after the bundler runs. - Colors are props. You set
strokeandfill. A CSS variable works in those attributes. Recharts does not read Tailwinddark:classes for you. - Keyboard layer. The shadcn chart docs tell you to set
accessibilityLayeron the chart. Those docs say the prop adds keyboard access and screen reader support. - Still maintained. GitHub recorded a push to recharts/recharts on 20 November 2026. The API listed archived as false. This app's
package.jsondepends onrecharts ^3.3.0.bun.lockresolves recharts 3.4.1, and that lock entry peers React through 19. - You assemble the chart. Tooltips, legends, and empty states are separate components. A stock MRR line is a short file. A custom mark means more components, or a move to visx.
What do shadcn charts add on top of Recharts?
The chart docs say the component is built using Recharts, and that you copy it into the app. The same page says the chart component now uses Recharts v3, and that the components are yours. shadcn-ui/ui is MIT on GitHub.
- Same SVG, plus a config object. You still render
LineChart,BarChart, and the other Recharts marks.ChartContainerreads achartConfigof labels and colors. - Client file, with a height. The docs' first chart starts with
"use client". Keep a height, amin-h-*class, or anaspect-*class onChartContainersoResponsiveContainercan measure on first render. - Copied source. The install command shown on that page was
pnpm dlx shadcn@latest add chart. It copiescomponents/ui/chart.tsxand you import Recharts yourself. This repository has nocomponents/ui/chart.tsx. - Tailwind dark mode is CSS variables. The docs put
--chart-1on:rootand again under.dark. The config setscolor: "var(--chart-1)". The mark then usesvar(--color-mrr), which the container defines from that key. For Recharts v3 the docs say to writevar(--chart-1). - This repo already has the tokens.
app/globals.cssdefines--chart-1through--chart-5on:rootand.dark.components.jsonis the new-york style, withrsc: trueand CSS variables. The root layout setsclassName="dark"onhtml. - Copy the file, then you own the diff. A Recharts upgrade is your edit, because the wrapper is source in the repo. GitHub recorded a push to shadcn-ui/ui on 20 November 2026. That date belongs to the component registry.
When is Tremor the dashboard kit?
The Tremor homepage, read on the check date, says the components are built with React, Tailwind CSS, and Radix UI. It also says charts are built on Recharts. A copy-paste donut on that page imports PieChart and ResponsiveContainer from recharts. Recharts draws SVG, so those charts draw SVG.
- Two ways in. The same page shows an npm import of
DonutChartfrom the Tremor React package, and a copy-paste block. Copy-paste files follow the Recharts peer range, because they import Recharts. - The npm package peers React 18. npm
latestfor that package was 3.18.7. The registry lists the license as Apache 2.0. Dependencies include recharts,@headlessui/react, and@floating-ui/react. The react peer is^18.0.0. It does not list React 19. - This template is React 19.
package.jsondepends on react 19.2.3 and next ^16.2.5. That puts the app outside the peer range the Tremor package declares. This page does not claim the package throws. It records the range. - Tailwind is the styling path. The homepage example passes a
classNameand acolorsarray. Dark mode is the Tailwind setup those components expect. This page does not quote a Tremor theme token list. - Keyboard copy is about the inputs. The homepage says the components are accessible by design, and that the filter inputs support keyboard navigation. It does not publish a chart accessibility test. Charts still go through Recharts.
- The GitHub repo last moved in 2025. tremorlabs/tremor is Apache-2.0. GitHub recorded a push on 10 October 2025. The API listed archived as false. A copied kit stays at the version you pasted until you copy it again.
When do Nivo, Chart.js, ECharts, or visx fit?
Nivo covers finished specialized charts. Chart.js is canvas. ECharts is one option object with a canvas or SVG renderer. visx is the SVG you compose yourself.
Nivo
The Nivo README says the charts sit on D3 and React. It lists SVG charts, HTML charts, and canvas charts, and it lists server-side rendering as a feature. Install @nivo/core and the chart package you use. The README example is @nivo/bar.
- MIT, and React 19 is in the peer range.
@nivo/lineand@nivo/corewere both 0.99.0 on npm. Both are MIT. The react peer includes 19. A line package pulls axes, scales, legends, and react-spring. That is the bundle shape: one chart family, plus those packages. - Measure in a client file. The README's server rendering note covers charts that already know their width. A responsive chart that reads the parent still needs the browser, so that file starts with the client directive.
- Theme object. The README links a theming guide. Colors come from that theme object.
- Pushed 21 July 2026. GitHub recorded a push to plouc/nivo on 21 July 2026. The API listed archived as false. Use Nivo when the chart is a sankey, a bump, a sunburst, or another finished form the homepage shows, and a Recharts line would be the wrong shape.
Chart.js and react-chartjs-2
The Chart.js repository description is "Simple HTML5 Charts using the canvas tag." npm chart.js 4.6.1 is MIT and lists @kurkle/color as its dependency. react-chartjs-2 5.3.1 is MIT, lists no runtime dependencies, and peers chart.js ^4.1.1 plus React through 19.
- Canvas means a client file. The wrapper attaches a chart to a
canvaselement. That file starts with the client directive. The server page passes data and options as plain values. - You name the canvas for assistive tech. The accessibility page says canvas content is not available to screen readers. You set
roleandaria-label, or you put fallback text inside the canvas tags. That page shows a last-updated stamp of 3/30/2021. The chart.js repository itself was pushed on 17 November 2026. react-chartjs-2 was pushed on 20 November 2026. - Colors live in the options object. Bars and lines are pixels, so Tailwind classes do not land on the marks. Read a CSS variable on the client and pass the color string, or set colors in the options. Dark mode is that update.
- Fit. Choose Chart.js when the team already has Chart.js options, or when the chart should be canvas. A shadcn tooltip and CSS-variable legend are a different stack.
Apache ECharts
The canvas and SVG handbook says canvas has been the renderer from the start. SVG is an extra option since v4.0. You pass renderer: "canvas" or renderer: "svg" to echarts.init. A full import * as echarts from "echarts" registers both renderers. A tree-shaken import from echarts/core needs echarts.use for the renderers you want.
- Apache-2.0, with a MIT React wrapper. npm echarts 6.1.0 is Apache-2.0. echarts-for-react 3.1.0 is MIT. Its peers are echarts 3 through 6, and React 15 or any later 16+ release, which includes 19. Init runs on a DOM node, so the chart file is a client component.
- Handbook size note. The handbook says canvas fits charts with many elements, and it calls more than 1,000 elements an experience value. It says SVG can use less memory when many chart instances sit on one page. This page did not rerun that comparison.
- Aria is off until you import it. The aria handbook says accessibility is off by default. From ECharts 5 you import
AriaComponentand setaria.showto true. ECharts then writes anaria-label. Decal patterns are a second encoding for color. You turn those on with the aria options. Tailwind dark mode is a theme object you swap when the theme changes. - Maintenance and fit. GitHub recorded a push to apache/echarts on 13 October 2026. The API listed archived as false. Choose ECharts when the dashboard needs that option object: large series, the SVG switch, or the generated description. A one-series MRR line is less code in Recharts.
visx
The visx README describes low-level visualization components. D3 does the math. React updates the DOM. The bar example is an svg element, a scale, and a Bar with a fill. The license is MIT. The README says v4 is the stable release and requires React 18 or 19.
- Install the packages you draw. The README says to keep the bundle down by installing only the packages you need.
@visx/visx4.0.0 is a meta package that depends on many scoped visx packages.@visx/xychart4.0.0 is the cartesian chart built from those primitives. Both are MIT, and both peer React 18 or 19. This page does not measure either client chunk. - Tailwind can sit on the SVG you write. The sample uses a fill attribute. Because the output is React SVG, a
classNameon those nodes can carry Tailwind classes, includingdark:variants. Nothing in the README maps--chart-1for you. - Accessibility is the SVG you add. The bar sample has no title and no aria label. You add
role="img", atitle, or a text alternative on the svg you own. - Animation is not included. The README FAQ says animation is left out on purpose, so the app can use the animation library it already ships. GitHub recorded a push to airbnb/visx on 22 June 2026. The API listed archived as false. Choose visx when the mark is custom SVG. A standard MRR line is more code here than in shadcn charts.
How should you choose?
Match the library to the dashboard you already have. The stack in this repository is Next.js, shadcn/ui, and Recharts.
- shadcn/ui is already in the app. Add the chart component. Keep Recharts v3. Point series colors at
--chart-1and the.darkoverride. - You want one chart dependency. Call Recharts from a client component, as
traffic-trend-card.tsxdoes. SetminWidth={0}onResponsiveContainerso a flex parent does not collapse the chart. - You want Tremor blocks. Copy the Recharts blocks if you are on React 19. Treat the npm package as a React 18 peer until that range changes.
- The chart is a sankey, a calendar, or a canvas scatter. Use Nivo, ECharts, or Chart.js for that chart. Keep ordinary lines on Recharts.
- The mark is custom. Use visx, or keep the small SVG this overview already uses for revenue versus visitors.
Buying a template does not pick the library for a chart you still have to design. The build versus buy guide compares a hosted metrics tool, a from-scratch Next.js build, and this template. The template comparison covers the analytics products around it.
How do you draw an MRR line with shadcn charts?
The file below is a client component. The three points are placeholders so the snippet has a shape. Treat them as literals in the example, with no Stripe source.
This repository has no components/ui/chart.tsx, so the import resolves only after you add that file. The chart docs' install line, as rendered on the check date, was pnpm dlx shadcn@latest add chart. This repo installs packages with Bun. recharts is already a dependency.
"use client"
import { CartesianGrid, Line, LineChart, XAxis } from "recharts"
import {
ChartContainer,
ChartTooltip,
ChartTooltipContent,
type ChartConfig,
} from "@/components/ui/chart"
const chartConfig = {
mrr: {
label: "MRR",
color: "var(--chart-1)",
},
} satisfies ChartConfig
const points = [
{ month: "Jan", mrr: 4200 },
{ month: "Feb", mrr: 4600 },
{ month: "Mar", mrr: 5100 },
]
export function MrrLineChart({
data = points,
}: {
data?: { month: string; mrr: number }[]
}) {
return (
<ChartContainer config={chartConfig} className="h-[240px] w-full min-w-0">
<LineChart accessibilityLayer data={data}>
<CartesianGrid vertical={false} />
<XAxis dataKey="month" tickLine={false} axisLine={false} tickMargin={8} />
<ChartTooltip content={<ChartTooltipContent />} />
<Line dataKey="mrr" type="monotone" stroke="var(--color-mrr)" strokeWidth={2} dot={false} />
</LineChart>
</ChartContainer>
)
}
Pass the array from a server page or from a client fetch. Keep the objects serializable: month string, mrr number. The MRR API guide is the normalization behind a real series. Stripe does not return an MRR field. A line needs one stored number per month. A single current total is a card, which is what the overview ships.
What does Data Lighthouse chart today?
Traffic is a Recharts area chart. Revenue versus visitors is a hand-built SVG. MRR and ARR are cards. The overview does not compute churn.
package.json depends on recharts ^3.3.0 and on the shadcn primitives this app already renders (Radix, class-variance-authority, lucide-react). It does not depend on Tremor, Nivo, Chart.js, ECharts, or visx.
components/data-lighthouse/traffic-trend-card.tsx is a client component. It imports AreaChart and ResponsiveContainer from recharts. The container sets height={120} and minWidth={0}. The area stroke is the hex #6366f1. The tooltip background is the hex #27272a. Those colors do not follow --chart-1.
components/data-lighthouse/overview-dashboard.tsx is also a client component. RevenueChart returns an svg with role="img"and the label "Revenue bars and visitor line". Bars use var(--primary). The visitor line uses var(--foreground). Each bar has a title with the day, the revenue, and the visitor count. This file does not import Recharts. There is no ComposedChart in the repository.
Signed-in overview numbers come from GET /api/datalighthouse/revenue. The route calls Clerk currentUser() and responds 401 without a session. MRR is calculateMrrFromSubscriptions on subscriptions listed with status: "active", so trialing is excluded. ARR is that MRR multiplied by 12. sumSucceededCharges totals succeeded charges and does not subtract amount_refunded. The chart payload is one point per day, with revenue and visitors. It is not an MRR history.
The client hook stores mrrChange as 0. The live MRR card is a current total. The public demo seeds sample MRR, sample ARR (that MRR times 12), and a sample revenue series. It does not call Stripe.
The overview does not compute churn, and it does not draw a churn chart. A churn series needs two snapshots of the book. The churn guide is that arithmetic. The SaaS metrics template page lists the cards the overview does ship. The shadcn and Supabase template page covers the same charts next to the Drizzle schema.
The license is $59 once. You host the Next.js app. The live demo is sample data. The pricing page is the buyer page. Checkout is the Polar payment after GitHub sign-in. The build guide walks the visitor chart if you are assembling the pipeline yourself.
7-day no-questions refund. If the template is not a fit, request it within 7 days through the purchase contact on the contact page.
Chart library FAQ
Short answers for the Next.js dashboard choice, and for what this template actually draws.
What is the best chart library for a Next.js dashboard?
For a dashboard that already uses shadcn/ui, use the shadcn chart component. It is Recharts in a client component, colored with your CSS variables. Data Lighthouse calls Recharts directly for the traffic area chart and draws revenue with its own SVG. The live demo is at https://datalighthouse.dev/demo. Pricing is at https://datalighthouse.dev/pricing.
Should I use Recharts, Tremor, or shadcn charts?
Use shadcn charts when the app already uses shadcn/ui. Use Recharts alone when you will set stroke and fill yourself. The Tremor npm package 3.18.7 declares a React 18 peer and does not list React 19. This template depends on React 19.2.3, so that package is outside the range it declares. Copy-paste Tremor blocks import Recharts.
Do chart libraries work in Next.js Server Components?
Put the chart in a file whose first line is the use client directive. Recharts, canvas charts, and any chart that measures its parent need the browser. A server page can load the series and pass a plain array into that client component.
Does Data Lighthouse chart MRR, ARR, and churn?
MRR and ARR are numbers on cards. MRR is Stripe subscriptions with status active, normalized to one month. ARR is that MRR multiplied by 12. The chart plots daily succeeded charges and visitors. The overview does not compute churn. The demo at https://datalighthouse.dev/demo uses sample numbers.
Which license do these chart libraries use?
Recharts, Nivo, Chart.js, react-chartjs-2, visx, and the shadcn/ui repository use the MIT license. Tremor and Apache ECharts use Apache-2.0. The React wrapper echarts-for-react uses MIT. Versions and licenses were read from GitHub and the npm registry on 21 November 2026.
Sources
Licenses, renderers, peers, and maintenance dates above come from these pages and from the npm registry on 21 November 2026. Product behavior comes from this repository on the same day.