npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-fontawesome-pro

v2.1.0

Published

Easily use your FontAwesome Pro 5.1 icons in React-Native.

Downloads

7,023

Readme

react-native-fontawesome-pro

Easily use your FontAwesome Pro 5.1 icons in React-Native.

v2 of this module takes advantage of enhancements in FontAwesome 5.1’s JS Package Cleanup and provides access to 409 new icons.

Want to install v1? View the old readme for FontAwesome Pro 5

Upgrading from v1?

If upgrading from a v1 installation uninstall the previous prerequisite FontAwesome packages:

npm uninstall --save @fortawesome/fontawesome-free-brands @fortawesome/fontawesome-pro-light @fortawesome/fontawesome-pro-regular @fortawesome/fontawesome-pro-solid

or

yarn remove @fortawesome/fontawesome-free-brands @fortawesome/fontawesome-pro-light @fortawesome/fontawesome-pro-regular @fortawesome/fontawesome-pro-solid

Installation Prerequisites

  1. Create a .npmrc file in the root of your project and the line below. Replace YOUR-TOKEN-HERE with your FontAwesome Pro token which you can find in your Font Awesome account https://fontawesome.com/account/services. More info: Font Awesome docs: Using a Package Manager

     @fortawesome:registry=https://npm.fontawesome.com/
     //npm.fontawesome.com/:_authToken=YOUR-TOKEN-HERE

    This will allow you to download the pro solid, regular and light font packages from the fontawesome pro repo.

  2. Install the FontAwesome Pro packages ( you will not be able to install them without the previous step )

     npm install --save @fortawesome/pro-light-svg-icons @fortawesome/pro-regular-svg-icons @fortawesome/pro-solid-svg-icons @fortawesome/free-brands-svg-icons

    or

     yarn add @fortawesome/pro-light-svg-icons @fortawesome/pro-regular-svg-icons @fortawesome/pro-solid-svg-icons @fortawesome/free-brands-svg-icons
  3. Install react-native-svg

     npm install --save react-native-svg

    or

     yarn add react-native-svg
  4. Link react-native-svg

     react-native link

    …or if you only want to link the single library:

     react-native link react-native-svg

    Note: Rebuilding the app for any simulator/emulator is required after running react-native link.

Installation

npm install react-native-fontawesome-pro --save

or

yarn add react-native-fontawesome-pro

The postinstall script will then automatically install the pro packages for you.

Usage

Configure FontAwesomePro in your main app.js file. Optionally set the default font from "regular" to "solid" or "light":

import { configureFontAwesomePro } from "react-native-fontawesome-pro";

configureFontAwesomePro();
// configureFontAwesomePro("solid");
// configureFontAwesomePro("light");

Add icons to a component:

import Icon from "react-native-fontawesome-pro";

<View>
  <Icon name="chevron-right" color="red" type="regular" onPress={() => alert("do something")} />
  <Icon name="chevron-right" color="blue" type="solid" size={24}/>
  <Icon name="chevron-right" color="green" type="light" size={10} />
</View>

Props

Values for the Icon name prop can be found on fontawesome.com/icons.

| prop | type | default value | | :- | :- | :- | | name | string | "" (If a valid name value is not provided, Font Awesome defaults to "question-circle") | | color | string, html color keyword or hexdecimal | "black" | | size | int | 20 | | type | string, one of the available Font Awesome prefix types: "regular", "solid", "light", or "brands" | "regular" | | iconStyle | style object | undefined | | containerStyle | style object | undefined | | onPress | function | undefined | | activeOpacity | number (beween 0 and 1) | 0.2 (same as default) |

PR's are welcome ¯\_(ツ)_/¯