React show svg
Simple react component that transforms plain svg to usable icon.
TL;DR
;;; Component { return <ReactShowSvg size="30px" fill="#000000" icon=SvgIcon /> ; }
NPM
$ npm install react-show-svg --save
Yarn
$ yarn add react-show-svg
Usage
Import raw svg file with svg-inline-loader and pass it
as icon
property.
You can also pass width & height
or size
properties ( pass size if you want width & height to be equal ).
IMPORTANT - Update your webpack config file:
const config = module: rules: test: /\.svg$/ use: loader: 'svg-inline-loader'
API
- icon:
string
- width:
string
- height:
string
- size:
string
( width & height ) - fill:
string
- className:
string
- onClick:
function
- ref:
function
- id:
string