Gathering detailed insights and metrics for react-svg-icon-generator
Gathering detailed insights and metrics for react-svg-icon-generator
Gathering detailed insights and metrics for react-svg-icon-generator
Gathering detailed insights and metrics for react-svg-icon-generator
typescript-react-svg-icon-generator
typescript-react-svg-icon-generator
react-svg-icon-generator-v2
Generate React Icon Component from SVG icons to show, resize and recolor them.
react-svg-icon-generator-standardmetrics
Generate React Icon Component from SVG icons to show, resize and recolor them.
react-svg-icon-generator-ts
Generate React Icon Component from SVG icons to show, resize and recolor them.
Generate React Icon Component from SVG icons to show, resize and recolor them.
npm install react-svg-icon-generator
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
64 Stars
98 Commits
21 Forks
25 Watchers
13 Branches
18 Contributors
Updated on Feb 05, 2024
Latest Version
0.5.2
Package Id
react-svg-icon-generator@0.5.2
Unpacked Size
37.86 kB
Size
10.81 kB
File Count
22
NPM Version
6.8.0
Node Version
11.10.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Generate React Icon Component from SVG icons to show, resize and recolor them.
We have prepared live demo for you at React SVG Icon Live Generator
📱Supports React Native 💕
yarn global add react-svg-icon-generator
yarn svg-icon-generate -- --svgDir ./icons --destination ./Icon.tsx
for detailed options run just yarn react-svg-icon-generator
source directory with SVG and this is output component from gulp task so in production you are without any dependencies at all.
you need to add this just to development, because it will generate self contained react component directly to your codebase
1npm install --save-dev react-svg-icon-generator
1const configureSvgIcon = require('react-svg-icon-generator').default; 2 3configureSvgIcon({ 4 destination: path.join(__dirname, 'components', 'Icon.js'), 5 svgDir: './icons', 6});
path.join(__dirname, 'icons')
absolute path so it will work in any directory of projectrun it by gulp svg-icon
1const configureSvgIcon = require('react-svg-icon-generator').default;
2
3configureSvgIcon({
4 comment: 'Generated by gulp svg-icon, if you add new icon run gulp svg-icon',
5 componentName: 'Icon',
6 destination: path.join(__dirname, 'components', 'Icon.js'),
7 keepFillColor: false,
8 native: false,
9 radium: true,
10 reactPureRender: true,
11 svgDir: path.join(__dirname, 'icons'),
12 template: path.join(__dirname, 'template', 'icon.nunjucks'),
13});
color
propimport {PureComponent} from 'react';
instead of import {Component} from 'react';
. If you use this, make sure you use React >= v15.3.0.run it by gulp svg-icon
1const {configureGenerator} = require('react-svg-icon-generator').default; 2 3const config = { 4 comment: 'Generated by gulp svg-icon, if you add new icon run gulp svg-icon-whatever', 5 destination: path.join(__dirname, 'components', 'Icon.js'), 6 reactPureRender: true, 7 svgDir: path.join(__dirname, 'icons'), 8 template: path.join(__dirname, 'template', 'icon.nunjucks'), 9} 10 11gulp.task('svg-icon-whatever', configureGenerator(config));
same as previous + your own task name
1import React, {Component} from 'react'; 2import Icon from './Icon'; 3 4export default class App extends Component { 5 render() { 6 return ( 7 <div> 8 Simple possible usage 9 <Icon kind='clock' /> 10 11 Setup color and bounding width and height 12 <Icon kind='close' color='#748' width={500} height={100} /> 13 14 Setup color and bounding width and height to size (square) 15 <Icon kind='close' color='red' size={600} /> 16 17 Setup custom style and className 18 <Icon kind="arrow_left" style={{transform: 'scaleX(-1)'}} className="custom-class" /> 19 20 Setup onClick behavior 21 <Icon kind='close' onClick={() => alert('clicked on icon')} /> 22 23 Show all icons at once with description (for finding right icon) 24 <Icon preview /> 25 </div> 26 ); 27 } 28}
any prop which is not listed will be passed directly to svg as rest props.
1git clone git@github.com:blueberryapps/react-svg-icon-generator.git 2cd react-svg-icon 3npm i 4npm link 5cd examples/simple 6npm link react-svg-icon-generator 7npm i 8gulp svg-icon 9npm start 10open http://127.0.0.1:3000
This package was build upon Library Boilerplate from Dan Abramov
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 8/14 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
101 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More