If you use React Native without Expo, please follow this guide instead. This guide applies to Expo native apps only.
react-native-vector-icons
supports Expo, and no further steps are required for native platforms, but you can optionally follow the steps below to set up the font config plugin. For web, see the web setup guide.
This is optional but recommended because through the config plugin, the icon font will be available in the app since build time, rather than being loaded at runtime - see more.
You need to use prebuild
, to be able to use config plugins.
- In your app.config.json / js, add the following:
module.exports = {
"expo": {
"plugins": [
[
"expo-font",
{
"fonts": [
"./node_modules/@react-native-vector-icons/<font-package>/fonts/<font-file>.ttf",
// example:
"./node_modules/@react-native-vector-icons/simple-line-icons/fonts/SimpleLineIcons.ttf"
]
}
]
]
}
}
- Run
npx expo prebuild --clean
. - Rebuild the app:
npx expo run:ios
ornpx expo run:android
.