@rogal/react-svg-example-icons

React Svg Example Icons

Usage no npm install needed!

<script type="module">
  import rogalReactSvgExampleIcons from 'https://cdn.skypack.dev/@rogal/react-svg-example-icons';
</script>

README

react-svg-example-icons

Converts your SVG files into React Components

Features:

  • Every time I uploaded a svg, automatically it creates the component

Installation

$ npm i --save @rogal/react-svg-example-icons

Usage

You only need to add the icon to svg folder Then you update the package.json, the package-lock.json and the Changelog and it's done.

Expected folder structure

A svg folder with all the .svg files to be converted inside

Output

A dist folder with the generated components will be created/overridden

How to use the generated lib

import { Icon, IconConstants } from "@rogal/react-svg-example-icons";

const Demo = () => {
  return <Icon type={IconConstants.ARROW_LEFT} />;
};

Template

Check out the component template in order to check its features here