Gathering detailed insights and metrics for react-svgmt
Gathering detailed insights and metrics for react-svgmt
Gathering detailed insights and metrics for react-svgmt
Gathering detailed insights and metrics for react-svgmt
npm install react-svgmt
Typescript
Module System
Node Version
NPM Version
JavaScript (98.51%)
HTML (0.95%)
Shell (0.54%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
120 Stars
88 Commits
16 Forks
3 Watchers
28 Branches
3 Contributors
Updated on Feb 26, 2025
Latest Version
3.0.0
Package Id
react-svgmt@3.0.0
Unpacked Size
46.25 kB
Size
15.57 kB
File Count
21
NPM Version
9.6.7
Node Version
18.17.1
Published on
Mar 27, 2025
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
2
1
26
react-svgmt (SVG Management Tools for React)
npm install react-svgmt@latest
Import the SvgLoader
and SvgProxy
elements
1import { SvgLoader, SvgProxy } from 'react-svgmt';
Example: Create a list CSS selectors and update each one
1function App() { 2 //We want to update only elements that match this selectors 3 const selectors = ["rect:nth-child(1)", "rect:nth-child(4)"]; 4 return ( 5 <div className="App"> 6 <SvgLoader width="100" height="100" path="/sample1.svg"> 7 <SvgProxy selector="rect" fill="red" /> 8 {selectors.map((selector, ix) => ( 9 <SvgProxy key={ix} selector={selector} fill="blue" /> 10 ))} 11 </SvgLoader> 12 </div> 13 ); 14}
If the path
prop is used, then the asset will be fetched from the url.
1<SvgLoader path="svg public url here"> 2 <SvgProxy selector="#Star" stroke={this.state.strokeColor} /> 3</SvgLoader> 4
There are two ways to load an SVG file:
path
prop)svgXML
prop)More features, API and examples see https://hugozap.github.io/react-svgmt
This library doesn't store previous elements state. Say you want to update some elements fill color and then change the selector to update another set of elements.
Don't expect the original element attributes to be reset back to their original state. You need to add a "reset" SvgProxy so all elements attributes are reseted before the additional SvgProxies are processed.
Check this CodeSandbox for an example.
This project is sponsored by Diagram.codes Studio
Author:
Special thanks (for contributing to the first version of this library) to:
The ajax loading bits are based on:
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/18 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
no effort to earn an OpenSSF best practices badge detected
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
63 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