Skip to main content

expo-font

Version: 55.0.4 Load custom fonts at runtime and use them in React Native components. Supports TTF, OTF, and web fonts with automatic loading and caching.

Installation

Usage

API Reference

useFonts Hook

(fontMap: FontSource) => [boolean, Error | null]
Loads fonts and returns loading stateReturns [loaded, error] tuple:
  • loaded: true when fonts are loaded
  • error: Error object if loading failed

loadAsync Method

(fontMap: FontSource) => Promise<void>
Loads fonts asynchronously
(fontFamily: string) => boolean
Checks if a font is loaded
(fontFamily: string) => boolean
Checks if a font is currently loading

FontSource Type

Examples

Basic Font Loading

With Splash Screen

Load Remote Fonts

Multiple Font Weights

Error Handling

Programmatic Loading

Check Font Status

Google Fonts Integration

Use with @expo-google-fonts:

Custom Font Hook

Config Plugin

Embed fonts in native projects: app.json:
Then rebuild:

TypeScript

Platform Support

Best Practices

  1. Keep Splash Screen: Use expo-splash-screen while fonts load
  2. Subset Fonts: Only include needed characters to reduce file size
  3. Preload Critical Fonts: Load essential fonts during app initialization
  4. Handle Errors: Always check for font loading errors
  5. Use Font Weights: Load separate files for different weights rather than relying on synthetic bold

Resources