Faradey27 / svg2react-icon

Generate React icon components from SVG raw files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

svg2react-icon

A library to generate reusable React Icon components from raw SVG icons

Features

  • Create a React Icon component file for each raw SVG icon file
  • Rename illegal SVG attributes
  • Optimize the SVG (remove comments, unnecessary parts, etc)
  • Remove colors so that the parent's font-color will be cascaded to the icon
  • Optional - output TypeScript components

Install

npm install --save-dev svg2react-icon

Sample usage

In your package.json:

{
  "scripts": {
    "build": "svg2react-icon [options] <inputDir> <outputDir>",
    ...
  }
}

Or in the command-line:

svg2react-icon [options] <inputDir> <outputDir>

Options:

  --typescript    generate TypeScript components instead of JS
  --monochrome    strip all fill and stroke attributes

License

MIT

About

Generate React icon components from SVG raw files

License:MIT License


Languages

Language:JavaScript 100.0%