Gathering detailed insights and metrics for @svgr/plugin-svgo
Gathering detailed insights and metrics for @svgr/plugin-svgo
Gathering detailed insights and metrics for @svgr/plugin-svgo
Gathering detailed insights and metrics for @svgr/plugin-svgo
npm install @svgr/plugin-svgo
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
10,588 Stars
648 Commits
422 Forks
35 Watching
3 Branches
130 Contributors
Updated on 26 Nov 2024
TypeScript (64.93%)
MDX (20.67%)
JavaScript (14.4%)
Cumulative downloads
Total Downloads
Last day
-6%
1,247,306
Compared to previous day
Last week
2.4%
6,996,773
Compared to previous week
Last month
5.6%
29,862,714
Compared to previous month
Last year
5.3%
336,433,839
Compared to previous year
Transform SVGs into React components 🦁
Watch the talk at React Europe
SVGR is an universal tool to transform SVG into React components.
SVGR takes a raw SVG and transforms it into a ready-to-use React component.
See the documentation at react-svgr.com for more information about using svgr
!
Quicklinks to some of the most-visited pages:
Take a SVG:
1<?xml version="1.0" encoding="UTF-8"?> 2<svg 3 width="48px" 4 height="1px" 5 viewBox="0 0 48 1" 6 version="1.1" 7 xmlns="http://www.w3.org/2000/svg" 8 xmlns:xlink="http://www.w3.org/1999/xlink" 9> 10 <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch --> 11 <title>Rectangle 5</title> 12 <desc>Created with Sketch.</desc> 13 <defs></defs> 14 <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 15 <g 16 id="19-Separator" 17 transform="translate(-129.000000, -156.000000)" 18 fill="#063855" 19 > 20 <g id="Controls/Settings" transform="translate(80.000000, 0.000000)"> 21 <g id="Content" transform="translate(0.000000, 64.000000)"> 22 <g id="Group" transform="translate(24.000000, 56.000000)"> 23 <g id="Group-2"> 24 <rect id="Rectangle-5" x="25" y="36" width="48" height="1"></rect> 25 </g> 26 </g> 27 </g> 28 </g> 29 </g> 30 </g> 31</svg>
Run SVGR
1npx @svgr/cli --icon --replace-attr-values "#063855=currentColor" -- icon.svg
Get an optimized React component
1import * as React from 'react' 2 3const SvgComponent = (props) => ( 4 <svg width="1em" height="1em" viewBox="0 0 48 1" {...props}> 5 <path d="M0 0h48v1H0z" fill="currentColor" fillRule="evenodd" /> 6 </svg> 7) 8 9export default SvgComponent
SVGR is a MIT-licensed open source project. It's an independent project with ongoing development made possible thanks to the support of these awesome backers. If you'd like to join them, please consider:
Learn more about supporting SVGR.
Check out the contributing guidelines
Licensed under the MIT License, Copyright © 2017-present Greg Bergé.
See LICENSE for more information.
This project has been popularized by Christopher Chedeau and it has been included in create-react-app thanks to Dan Abramov. We would like to thanks Sven Sauleau for his help and its intuition.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 19/27 approved changesets -- score normalized to 7
Reason
0 commit(s) and 1 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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
63 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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