react-native-commonicon

react native icon component

Usage no npm install needed!

<script type="module">
  import reactNativeCommonicon from 'https://cdn.skypack.dev/react-native-commonicon';
</script>

README

React Native Common Icon

Getting started

yarn add react-native-commonicon

Generate ttf file

  if ("react-native-vector-icons" in package.json){
    react-native link
  }
  else{
    Insert into package.json
    "dependencies": {
    ...
    "react-native-vector-icons": "^6.6.0",
    ...
    }
    react-native link
    Delete react-native-vector-icons": "^6.6.0" from package.json
  }

Usage

import React from "react";
import {
  View,
  StyleSheet
} from "react-native";

import CommonIcon from 'react-native-commonicon';

export default class App extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <View style={styles.container}>
        <CommonIcon iconType='FontAwesome' iconName='search' title='Tophill' color='#313748' style={{margin:40}} onPress={()=>console.log('CommonIcon Text')}/>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff'
  }
});

Component props

Prop Required Type default description
iconType YES string none Entypo,EvilIcons,Feather,FontAwesome,Foundation,Ionicons,MaterialIcons,MaterialCommunityIcons,Octicons,Zocial
iconName YES string none
touchable NO bool true
onPress NO func none
color NO string '#FFF'
size NO number 20
title NO string none
titleSize NO number 14
style NO array or object none