1.0.0 • Published 7 years ago
react-svg-partial-fill v1.0.0
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
1.0.0
7 years ago