This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 57).
Expo Font
A library that allows loading fonts at runtime and using them in React Native components.
expo-font allows loading fonts from the web and using them in React Native components. See more detailed usage information in the Fonts guide.
Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Configuration in app config
There are two ways to add fonts to your app: using the expo-font config plugin (recommended for Android and iOS) or loading them at runtime (which works across all platforms including web).
On Android and iOS, the plugin allows you to embed font files at build time which is more efficient than useFonts or loadAsync. After you set up the config plugin and run prebuild, you can render custom fonts right away. The plugin can be configured in different ways, see the Fonts guide on how to use it.
Example app.json with config plugin
Configurable properties
Are you using this library in an existing React Native app?
- Android: Copy font files to android/app/src/main/assets/fonts.
- iOS: See Adding a Custom Font to Your App in the Apple Developer documentation.
Usage
If you don't want to use the config plugin, you can load a font at runtime with the useFonts hook, as shown in the snippet:
Variable fonts
The Roboto Flex entry in the example above is a variable font: one file that holds many faces. You select a face with the fontWeight and fontStyle style props. Variable fonts also work with useFonts. To learn more, see Variable fonts in the Fonts guide.
Multiple weights and styles
A font family can also hold several static font files, for example regular, bold, and italic cuts. To load them under a single fontFamily name, pass useFonts or loadAsync an array of FontFamilyDefinitions instead of a map. Then select a face with the fontWeight and fontStyle style props. To learn more, see Loading multiple weights and styles for one font family in the Fonts guide.
API
import * as Font from 'expo-font';
No API data file found, sorry!