React Native Vector Icons

repository·master·Indexed 30 days ago

https://github.com/oblador/react-native-vector-icons

Provides customizable, scalable vector icons for React Native applications using a package-per-icon-set architecture. Supports various icon sets like AntDesign, Entypo, Feather, and FontAwesome. Features specialized support for Expo via static and dynamic loading modes, including Expo Config Plugins for seamless integration.

Tokens
22.2K
Snippets
133
Records
183
Agent score
96%

What's inside react-native-vector-icons

  1. Install FontAwesome 6 Pro fonts

    master

    To use FontAwesome 6 Pro, you must first install the Pro fonts into your repository using your FontAwesome npm token (available in your FontAwesome account under the Services tab).

    Using the CLI upgrade tool

    Run the following command and enter your token when prompted:

    npx fa-upgrade6

    By default, this installs fonts into the rnvi-fonts/fontawesome6-pro directory. You can customize the destination directory by providing a path to the command:

    npx fa-upgrade6 [destination]

    Note: If you change the destination, you must also update the fontDir field in your package.json to match.

    Manual Installation

    If the shell script fails, you can manually add the Pro font files to the rnvi-fonts/fontawesome6-pro directory.

  2. Generate individual icon packages with generator-react-native-vector-icons

    master

    The generator-react-native-vector-icons package is used to generate individual icon packages within the repository. To use the generator, you must first build the generator itself and its dependencies before running the generation command from the repository root.

    Follow these steps:

    1. Build the generator: Run pnpm run watch-tsc within the packages/generator-react-native-vector-icons directory.
    2. Build dependencies: Run pnpm run watch-deps within the packages/generator-react-native-vector-icons directory.
    3. Execute generation: Run pnpm run generate from the root of the repository to create the individual icon packages.
    # 1. In packages/generator-react-native-vector-icons
    pnpm run watch-tsc
    pnpm run watch-deps
    
    # 2. In the repository root
    pnpm run generate
  3. Install React Native Vector Icons packages

    master

    To use specific icon sets, install the individual packages for the icons you want. For example, to install FontAwesome Free Solid and EvilIcons:

    npm install @react-native-vector-icons/fontawesome-free-solid @react-native-vector-icons/evil-icons

    After installation, follow the platform-specific setup instructions for iOS, Android, or Windows.