Installation
Install the package, import the stylesheet once, then render a chart.
Install
React, React DOM and Motion are peer dependencies. npm 7 and newer installs them when compatible versions are missing. peakcharts requires React 18 or newer.
Render a chart
Import the stylesheet once, for example in your root layout. Then render any chart.
Click a mark to pin its value
View data
| Label | Value |
|---|---|
| Jan | 32 |
| Feb | 46 |
| Mar | 63 |
Use it with Next.js
The App Router works as is. The bundle ships with "use client", so you can import charts from server components or your root layout. Charts do not touch window or document, so they render on the server too.
Charts are plain SVG styled with CSS variables, so any evergreen browser works. If the chart looks unstyled, see Troubleshooting.