react-svg-partial-fill
v1.0.0
Published
React component that fills an SVG shape by a specified amount
Downloads
2
Maintainers
Readme
react-svg-partial-fill
React component that fills an SVG shape by a specified amount.
Installation
npm install --save react-svg-partial-fill
Usage
const fs = require('fs')
const SvgPartialFill = require('react-svg-partial-fill')
const svgString = fs.readFileSync('./shape.svg', 'utf8')
// ...
render() {
return <SvgPartialFill svg={svgString} percent={50} fill="lightskyblue" />
}
The component accepts the following props:
width
- the display widthheight
- the display heightbackground
- the background color of thefill
- the color to fill the SVG withpercent
- the percentage to fill the shapesvg
- the contents of an SVG file as astring
style
- a JSX style object
License
MIT © Luke Mitchell