A simple and styleable donut component
npm install react-donut-component
A simple, styleable and easy to use donut component.
npm install react-donut-component
`
Usage
> [Try it out in the browser][code-sandbox-try-it-out]
`jsx
import React from 'react'
import { Donut } from 'react-donut-component'
const App = () => (
70
);
`
#### Preview:
!donut-example
$3
> When you put a label, you have to specify the value with DonutValue component
`jsx
import React from 'react'
import { Donut, DonutValue, DonutLabel } from 'react-donut-component'
const App = () => (
70
My label
);
`
#### Preview:
!donut-example
$3
> There are many style props with the format 'styleSomething'.
See API
`jsx
import React from 'react'
import { Donut, DonutValue, DonutLabel } from 'react-donut-component'
const App = () => (
styleTrack={{ strokeWidth: 9, stroke: 'AliceBlue' }}
styleIndicator={{ stroke: 'Cyan', strokeLinecap: 'round' }}
>
style={{ fontWeight: 'bold' }}
symbol='°C'
styleSymbol={{ fontWeight: 'bold', fontSize: '18px' }}
symbolPosition='top-right'
>
79
);
`
#### Preview:
!donut-example
Usage with multiple values
We provide a component called DonutMultiple, which can receive multiple DonutElement values that are calculated relatively.
`jsx
import React from 'react'
import { DonutMultiple, DonutElement, DonutLabel } from 'react-donut-component'
const App = () => (
6
5
Ballon d'ors
);
``