This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

react-svgicon

0.0.2 • Public • Published

react-svgicon

React component for rendering inline SVGs via an SVG sprite.

Installation

$ npm install react-svgicon --save

Usage

var Icon = require('react-svgicon');
 
var Example = React.createClass({
  render: function() {
    return {
      Icon({
        name: 'icon-clock',   // String | required | xlink-href of your inline SVG without the #
        className: 'myClass', // String | optional
        style: {}             // Object | optional
      })
    }
  }
});

Note: This library assumes you have already loaded your SVG sprite at the top of your <body> element like this:

<body>
  <svg xmlns="http://www.w3.org/2000/svg" class="is-hidden">
    <symbol viewBox="0 0 36 36" id="icon-clock">
      <!-- SVG path/polygon code here -->
    </symbol>
  </svg>
  <!-- rest of code -->
</body>

Contributing

  • Fork it
  • Create a feature branch
    $ git checkout -b my-feature-branch
  • Create a pull request

Development

Building the example code:

$ npm run build:example

Compiling the src:

$ npm run prepublish

Run the specs:

$ npm test

Readme

Keywords

Package Sidebar

Install

npm i react-svgicon

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • rpearce