Skip to content

Instantly share code, notes, and snippets.

@fcaldarelli
Created August 17, 2019 21:59
Show Gist options
  • Save fcaldarelli/9bfd8c953ac4f9aee8d84b71c152a427 to your computer and use it in GitHub Desktop.
Save fcaldarelli/9bfd8c953ac4f9aee8d84b71c152a427 to your computer and use it in GitHub Desktop.
Expo Icon Selector for React Native
import React from "react";
import { View } from "react-native";
import { AntDesign, Entypo, EvilIcons, Feather, FontAwesome, FontAwesome5, Foundation, Ionicons, MaterialCommunityIcons, MaterialIcons, Octicons, SimpleLineIcons, Zocial } from '@expo/vector-icons';
export default class ExpoIconSelector extends React.Component {
render() {
return (
<View>
{this.props.coll == 'AntDesign' && <AntDesign {...this.props}></AntDesign> }
{this.props.coll == 'Entypo' && <Entypo {...this.props}></Entypo>}
{this.props.coll == 'EvilIcons' && <EvilIcons {...this.props}></EvilIcons>}
{this.props.coll == 'Feather' && <Feather {...this.props}></Feather>}
{this.props.coll == 'FontAwesome' && <FontAwesome {...this.props}></FontAwesome>}
{this.props.coll == 'FontAwesome5' && <FontAwesome5 {...this.props}></FontAwesome5>}
{this.props.coll == 'Foundation' && <Foundation {...this.props}></Foundation>}
{this.props.coll == 'Ionicons' && <Ionicons {...this.props}></Ionicons>}
{this.props.coll == 'MaterialCommunityIcons' && <MaterialCommunityIcons {...this.props}></MaterialCommunityIcons>}
{this.props.coll == 'MaterialIcons' && <MaterialIcons {...this.props}></MaterialIcons>}
{this.props.coll == 'Octicons' && <Octicons {...this.props}></Octicons>}
{this.props.coll == 'SimpleLineIcons' && <SimpleLineIcons {...this.props}></SimpleLineIcons>}
{this.props.coll == 'Zocial' && <Zocial {...this.props}></Zocial>}
</View>
);
}
}
<ExpoIconSelector style={{ fontSize: 24 }} coll="Ionicons" name="md-time"></ExpoIconSelector>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment