Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-js-vector-icons

sturmenta196MITdeprecated0.0.4

react-js-vector-icons Now is deprecated, use instead react-web-vector-icons

An adaptation of react-native-vector-icons for reactjs

react, reactjs, icon, icons, vector, vector-icons, react-js-vector-icons, react-native-vector-icons, oblador, sturmenta, Entypo, EvilIcons, Feather, Feather, FontAwesome, Foundation, Ionicons, MaterialCommunityIcons, MaterialIcons, Octicons, SimpleLineIcons, Zocial

readme

react-js-vector-icons

An adaptation of react-native-vector-icons for reactjs

Installation

  • Install npm package
npm i -S react-js-vector-icons

Usage

1 - Add css font-face for all fonts in your index.html file

 <style>@font-face{font-family:Entypo;font-style:normal;font-weight:400;src:url(fonts/Entypo.ttf) format('truetype')}@font-face{font-family:EvilIcons;font-style:normal;font-weight:400;src:url(fonts/EvilIcons.ttf) format('truetype')}@font-face{font-family:Feather;font-style:normal;font-weight:400;src:url(fonts/Feather.ttf) format('truetype')}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/FontAwesome.ttf) format('truetype')}@font-face{font-family:Foundation;font-style:normal;font-weight:400;src:url(fonts/Foundation.ttf) format('truetype')}@font-face{font-family:Ionicons;font-style:normal;font-weight:400;src:url(fonts/Ionicons.ttf) format('truetype')}@font-face{font-family:MaterialCommunityIcons;font-style:normal;font-weight:400;src:url(fonts/MaterialCommunityIcons.ttf) format('truetype')}@font-face{font-family:MaterialIcons;font-style:normal;font-weight:400;src:url(fonts/MaterialIcons.ttf) format('truetype')}@font-face{font-family:Octicons;font-style:normal;font-weight:400;src:url(fonts/Octicons.ttf) format('truetype')}@font-face{font-family:SimpleLineIcons;font-style:normal;font-weight:400;src:url(fonts/SimpleLineIcons.ttf) format('truetype')}@font-face{font-family:Zocial;font-style:normal;font-weight:400;src:url(fonts/Zocial.ttf) format('truetype')}</style>

2 - Add require of fonts for webpack in your index.js file

require('react-js-vector-icons/fonts');

3 - Use

import Icon, { FontAwesome, Feather } from 'react-js-vector-icons';
<Icon 
  name='tools'
  font='Entypo'
  color='green'
  size={20}
  // style={{}}
/>

<FontAwesome 
  name='bell'
  color='white'
  size={30}
  // style={{}}
/>

<Feather 
  name='award'
  color='#007ACC'
  size={40}
  // style={{}}
/>

-------- Soon a very complete demo --------

Special thanks to: https://github.com/oblador

License

MIT.

Author

Nicolas Sturm -- sturmenta