Gathering detailed insights and metrics for react-native-svg-icon
Gathering detailed insights and metrics for react-native-svg-icon
Gathering detailed insights and metrics for react-native-svg-icon
Gathering detailed insights and metrics for react-native-svg-icon
lucide-react-native
A Lucide icon library package for React Native applications.
react-icomoon
It makes it very simple to use SVG icons in your React and React-Native projects.
iconoir-react-native
React Native library for Iconoir, the biggest open source icon library with tons of free icons.
healthicons-react-native
React Native icon library for the Health Icons set
A simple, but flexible SVG icon component for React Native
npm install react-native-svg-icon
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
179 Stars
46 Commits
11 Forks
3 Watchers
10 Branches
3 Contributors
Updated on Mar 13, 2025
Latest Version
0.10.0
Package Id
react-native-svg-icon@0.10.0
Size
4.85 kB
NPM Version
7.0.14
Node Version
15.3.0
Published on
Mar 22, 2021
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
A simple, but flexible SVG icon component for React Native. Read the introductory blog post.
react-native-svg
npm i react-native-svg-icon --save
Create an object of your SVG icons
1import React from 'react'; 2import { G, Path } from 'react-native-svg'; 3 4// Each nameValuePair can be: 5// * Name: <Svg />; or 6// * Name: { svg: <Svg />, viewBox: '0 0 50 50' } 7 8export default { 9 SortArrows: <G><Path d="M0 45h90L45 0 0 45z"/><Path d="M0 55h90l-45 45L0 55z"/></G>, 10 Tick: { 11 svg: <Path d="M38.729 75.688a4.48 4.48 0 0 1-3.21-1.356L16.558 55.004c-1.774-1.807-1.774-4.736-.001-6.543a4.48 4.48 0 0 1 6.42 0l15.753 16.056 37.749-38.474a4.478 4.478 0 0 1 6.419 0c1.773 1.806 1.773 4.736 0 6.543L41.939 74.332a4.48 4.48 0 0 1-3.21 1.356z"/>, 12 viewBox: '0 0 50 50', 13 }, 14}
To conform to React/JSX standards, we need to convert SVG elements to begin with a capital letter, and convert hyphenated attributes to camelCase. For example. <path>
becomes <Path>
and stop-color
becomes stopColor
.
Create an <Icon />
component as a bridge between react-native-svg-icon's <SvgIcon />
which import
s the above SVGs
1import React from 'react'; 2import SvgIcon from 'react-native-svg-icon'; 3import svgs from './assets/svgs'; 4 5const Icon = (props) => <SvgIcon {...props} svgs={svgs} />; 6 7export default Icon;
Use your <Icon />
in your views.
1import Icon from './components/Icon'; 2 3// Inside some view component 4render() { 5 return ( 6 <Fragment> 7 <Icon name="SortArrows" height="20" width="20" /> 8 <Icon name="Tick" fill="#0f0" viewBox="0 0 200 200" /> 9 <Icon name="Star" fill="transparent" stroke="#fff" strokeWidth="5" /> 10 </Fragment> 11 ); 12}
Pro Tip: An SVG name suffixed with '.ios'
or '.android'
will automatically be rendered on the appropriate platform when passing the base name as the name
prop.
1{ 2 fill: '#000', 3 fillRule: 'evenodd', 4 height: '44', 5 width: '44', 6 viewBox: '0 0 100 100', 7}
These can be overridden in your <Icon />
's defaultProps
or an a per instance basis.
1{ 2 defaultViewBox: string, 3 fill: string.isRequired, 4 fillRule: string, 5 height: oneOfType([number, string]).isRequired, 6 name: string.isRequired, 7 stroke: string, 8 strokeWidth: oneOfType([number, string]), 9 style: oneOfType([array, object]), 10 svgs: object.isRequired, 11 width: oneOfType([number, string]).isRequired, 12 viewBox: string, 13}
The specificity order for viewBox
is:
<Icon viewBox />
{ Name: { viewBox: '' } }
Icon.defaultProps.defaultViewBox
SvgIcon.defaultProps.viewBox
Copyright (c) 2018 Matt Stow
Licensed under the MIT license (see LICENSE for details)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/25 approved changesets -- score normalized to 1
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
46 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