
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
react-svg-donuts
Advanced tools
A React component for simple (and complex) SVG donuts.
The current version depends on the Hooks API introduced with React 16.8. If you need legacy React support, please use a 1.x.x version.
TL;DR here is the demo
First install the package
$ npm i react-svg-donuts
# or
$ yarn add react-svg-donuts
Then
import React from 'react';
import { Donut, ComplexDonut } from 'react-svg-donuts';
// The donut will be half filled
const progress = 50;
// The value will be wrapped inside a <strong> tag.
const renderProgress = progress => <strong>{progress}%</strong>;
const MyComponent = () => (
<>
<Donut progress={progress} onRender={renderProgress} />, document.getElementById('demo')
<ComplexDonut
size={200}
parts={[
{
color: '#FF8A80',
value: 230
},
{
color: '#FF80AB',
value: 308
},
{
color: '#B9F6CA',
value: 520
},
{
color: '#B388FF',
value: 130
},
{
color: '#8C9EFF',
value: 200
}
]}
radius={80}
thickness={40}
startAngle={-90}
/>
</>
);
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
prefix | string | false | 'donut' | String used as a prefix for the CSS class names |
progress | number | false | 0 | A number between 0 and 100 |
onRender | Function | false | (progress) => {progress} | Function which runs after the Donut is rendered and returns a ReactNode |
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| size | number | false | 160 | The width and height of the donut |
| parts | { color: string; value: number; }[] | false | [] | The donut parts |
| radius | number | false | 60 | The radius of the element |
| className | string | false | '' | Custom CSS class name for the Donut |
| thickness | number | false | 30 | Stroke width of the element |
| textProps | SVGProps for SVGTextElement | false | {} | Additional props for the element |
| startAngle | number | false | -90 | Number between -360 and 360 |
| circleProps | SVGProps for SVGCircleElement | false | {} | Additional props for the element |
There is a predefined stylesheet which can be used as is. If you want it, just import it:
@import 'react-svg-donuts/src/index.css';
or
import 'react-svg-donuts/src/index.css';
MIT
FAQs
A ReactJS component for simple SVG donut graphs.
The npm package react-svg-donuts receives a total of 66 weekly downloads. As such, react-svg-donuts popularity was classified as not popular.
We found that react-svg-donuts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.