2.0.1 • Published 7 years ago

svg2component v2.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

svg2component

Converts SVG icons into React components.

Example

icon.svg:

<svg xmlns="http://www.w3.org/2000/svg">
    <circle stroke-width="2" fill="#191919" stroke="#424242"></circle>
</svg>
$ svg2component icon.svg > icon.js

icon.js:

import React from 'react';

const Icon = ({size, color='#191919', strokeColor='#424242'}) => (
    <svg width={size} height={size}>
        <circle strokeWidth="2" fill={color} stroke={strokeColor}></circle>
    </svg>;
);
2.0.1

7 years ago

2.0.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago