New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-svg-iconfont

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-svg-iconfont

svg react-native iconfont

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-svg-iconfont

安装

  • npm: npm install react-native-svg-iconfont --save
  • Yarn: yarn add react-native-svg-iconfont
  • 此组件依赖于react-native-svg,需要link react-native-svg, 运行 react-native link react-native-svg

用法

阿里图标库 下载SVG格式的图标,复制svg路径保存在js文件中 例子 example/path.js svg文件也可以让UI提供自定义图标

    import React, { Component } from 'react';
    import {
      Platform,
      StyleSheet,
      Text,
      View,
      StatusBar,
      ScrollView, PermissionsAndroid
    } from 'react-native';
    import * as iconPath from './path'
    import SvgIcon from 'react-native-svg-iconfont'
    export default class Example extends Component {
    
      render() {
        return (
          <View style={styles.container}>
             <View style={{height: 44, marginTop: 44, justifyContent: 'center', alignItems: 'center'}}>
                <Text>Test</Text>
                <SvgIcon path={iconPath.weibo} fill={['#FFFFFF', '#511017', '##F43B51', '##4F3636', '#FFFFFF', '#FFFFFF', '#81DB61', '#16380A']}/>
             </View>
          </View>
        );
      }
    }
    
    const styles = StyleSheet.create({
      container: {
        backgroundColor: '#fff',
      }
    });
    
    

属性

名字默认值类型描述
size40number图标大小
pathundefinedarraysvg路径 是一个数组 必填
fill['#039FFC']array路径颜色 如果多个颜色与svg路径一一对应
styleundefinedobjectstyle
viewBox'0 0 1024 1024'string画板大小默认为1024*1024 请确保此值保持一致,否则会出现图标缺失或大小不一的情况

License

Keywords

FAQs

Package last updated on 03 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc