Description
React Sparklines is a React component library for drawing sparklines, which are small inline charts that show the shape of a data series without axes or labels. The components render as SVG, so the charts stay sharp at any size. A Sparklines container takes the data set and draws the chart inside it, and you pass child components to choose how the data is shown. The README lists basic lines, bars, spots, reference lines and a normal band as built-in examples. The container's props control the layout. The data prop is the data set, and limit optionally caps how many points show at once. The width and height values set the dimensions inside the SVG viewBox, and by default the chart scales responsively to its parent. If you need fixed pixel sizes instead, svgWidth and svgHeight set absolute dimensions. The preserveAspectRatio prop changes how the chart scales, with a default of none. The margin prop offsets the chart, and min and max bound its vertical range. To see the examples, you run the demo included in the repository, and the live demos and documentation are hosted on the project's GitHub Pages site. The component is free and open source.…
Highlights
- Small inline SVG charts for React
- Line, bar, spot, reference line and normal band views
- Responsive by default, with fixed sizes optional
- Limit, margin and min or max bounds
- Live demos and examples in the repository
Ratings & Reviews
No ratings yet
Be the first to rate react-sparklines.
People also visit
react-sparklines FAQ
What is a sparkline?
A small chart that shows the trend of a data series, typically placed inline with text or in a table.
How do I use it?
Import the Sparklines component and the child components you need, pass your data as a prop, and render the chart in your React tree.
Does it resize with its parent?
Yes, by default. Set svgWidth and svgHeight if you want fixed pixel dimensions.
Which chart styles are included?
The README shows basic sparklines, bars, spots, a reference line and a normal band.
How do I see examples?
Run the demo from the repository, or open the live demos and documentation on the project's GitHub Pages site.
What are the best react-sparklines alternatives?
Popular alternatives to react-sparklines include react-charty, essential js 2 charts and react-chartjs. See all react-sparklines alternatives


















