🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

react-native-font-global

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-font-global

React Native apply custom font for iOS and Android

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-font-global

React Native apply custom font for iOS and Android

Installation

  • Add font file to your app src/assets/fonts/

  • In react-native.config.js :

    module.exports = {
      ...
      project: {
        ios: {},
        android: {},
      },
      assets: ['./src/assets/fonts'],
      ...
    };
    
  • Install package

    using npm

    npm install react-native-font-global
    

    using yarn

    yarn add react-native-font-global
    
  • Link Fonts

    react-native link
    
  • iOS

    pod install
    
  • Android (Auto-linking)

Usage

Go to your first component which wraps the whole application (mostly App.js).

import applyFontGlobally from 'react-native-font-global';

applyFontGlobally('YourCustomFontName');

Example App

Example app can be found in example/ directory.

How to use and run example

  • Clone Repository

    git clone https://github.com/ajaybhatia/react-native-font-global
    
  • Swtich to example directory

    cd example
    
  • Install dependencies

    npm install
    
  • Run example

    Android:

    react-native run-android
    

    iOS:

    pod install
    
    react-native run-ios
    

Keywords

React Native

FAQs

Package last updated on 08 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts