0.0.10 • Published 7 months ago

@swiftread/fontawesome v0.0.10

Weekly downloads
-
License
-
Repository
github
Last release
7 months ago

🎨 React Native FontAwesome

import { FaSolidAddressBook } from '@swiftread/fontawesome'

export const Icon = () => <FaSolidAddressBook />

Overview

This library exports React Native components for each of FontAwesome's 2,025 free icons. Based on nandorojo's react-native-heroicons.

  • 😎 Free, beautiful icons
  • 🔥 Customizable with react-native-svg props
  • 🌲 Tree-shaken components
  • 🤖 TypeScript support
  • 📈 JS-only (+ works with Expo)

Installation

yarn add @swiftread/fontawesome react-native-svg

Usage

Each icon is exported as its own component with an adjusted name.

For example, to use the solid address-book icon, import FaSolidAddressBook:

import { FaSolidAddressBook } from '@swiftread/fontawesome'

You can also import * as Fontawesome:

import * as FontAwesome from '@swiftread/fontawesome'

export const Icon = () => <FontAwesome.FaSolidAddressBook />

For a full directory of components, see the FontAwesome website.

Custom color

<FaSolidAddressBook color="black" />

Custom size

<FaSolidAddressBook height={30} width={30} />

Props

Each icon component accepts all the props from react-native-svg's Svg component. Reference their docs.

How it works

This library uses react-native-svg. The components are generated by svgr. I downloaded all the free icons from FontAwesome and ran a script to codegen the files from there.

Contributing

Since FontAwesome updates their icons somewhat frequently, you may want to import the new ones. These are the steps to update this library with new icons:

  1. Fork this repo
  2. Download the full folder of free icons from FontAwesome
  3. Replace the generate/fontawesome/svgs folder with the the svgs folder you downloaded
  4. Run yarn install and yarn prepare
  5. Commit your changes, and open a PR!
0.0.10

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago