1.0.1 • Published 5 years ago

react-native-commonicon v1.0.1

Weekly downloads
9
License
-
Repository
github
Last release
5 years ago

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

PropRequiredTypedefaultdescription
iconTypeYESstringnoneEntypo,EvilIcons,Feather,FontAwesome,Foundation,Ionicons,MaterialIcons,MaterialCommunityIcons,Octicons,Zocial
iconNameYESstringnone
touchableNObooltrue
onPressNOfuncnone
colorNOstring'#FFF'
sizeNOnumber20
titleNOstringnone
titleSizeNOnumber14
styleNOarray or objectnone