Skip to content

Fonts

This starter uses the expo-font config plugin to load fonts natively, providing optimal performance and ensuring fonts are available immediately when your app starts.

The template comes pre-configured with the Inter font family including 4 weights:

  • Regular (400)
  • Medium (500)
  • SemiBold (600)
  • Bold (700)

Inter is configured as the default sans-serif font in the Tailwind CSS theme, so all text uses Inter by default.

Since Inter is configured as the default font-sans, you can use standard Tailwind font classes:

import { Text } from 'react-native';
<Text className="font-sans font-normal">Regular Text (400)</Text>
<Text className="font-sans font-medium">Medium Text (500)</Text>
<Text className="font-sans font-semibold">SemiBold Text (600)</Text>
<Text className="font-sans font-bold">Bold Text (700)</Text>

You can also use the font directly with React Native style props:

<Text style={{ fontFamily: 'Inter', fontWeight: '400' }}>Regular Text</Text>
<Text style={{ fontFamily: 'Inter', fontWeight: '500' }}>Medium Text</Text>
<Text style={{ fontFamily: 'Inter', fontWeight: '600' }}>SemiBold Text</Text>
<Text style={{ fontFamily: 'Inter', fontWeight: '700' }}>Bold Text</Text>

To add a new Google Font to your app, follow these steps:

Install the desired font from the @expo-google-fonts collection:

Terminal window
pnpm add @expo-google-fonts/roboto

Add the font to your expo-font plugin configuration with platform-specific settings:

app.config.ts
export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
plugins: [
[
'expo-font',
{
ios: {
fonts: [
'node_modules/@expo-google-fonts/inter/400Regular/Inter_400Regular.ttf',
'node_modules/@expo-google-fonts/inter/500Medium/Inter_500Medium.ttf',
'node_modules/@expo-google-fonts/inter/600SemiBold/Inter_600SemiBold.ttf',
'node_modules/@expo-google-fonts/inter/700Bold/Inter_700Bold.ttf',
// Add your new font
'node_modules/@expo-google-fonts/roboto/400Regular/Roboto_400Regular.ttf',
'node_modules/@expo-google-fonts/roboto/700Bold/Roboto_700Bold.ttf',
],
},
android: {
fonts: [
{
fontFamily: 'Inter',
fontDefinitions: [
{
path: 'node_modules/@expo-google-fonts/inter/400Regular/Inter_400Regular.ttf',
weight: 400,
},
{
path: 'node_modules/@expo-google-fonts/inter/500Medium/Inter_500Medium.ttf',
weight: 500,
},
{
path: 'node_modules/@expo-google-fonts/inter/600SemiBold/Inter_600SemiBold.ttf',
weight: 600,
},
{
path: 'node_modules/@expo-google-fonts/inter/700Bold/Inter_700Bold.ttf',
weight: 700,
},
],
},
// Add your new font family
{
fontFamily: 'Roboto',
fontDefinitions: [
{
path: 'node_modules/@expo-google-fonts/roboto/400Regular/Roboto_400Regular.ttf',
weight: 400,
},
{
path: 'node_modules/@expo-google-fonts/roboto/700Bold/Roboto_700Bold.ttf',
weight: 700,
},
],
},
],
},
},
],
],
});

If you want to use the font with Tailwind CSS, add it to your theme in src/global.css:

src/global.css
@theme {
/* Font families */
--font-family-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
--font-family-roboto: 'Roboto', ui-sans-serif, system-ui, sans-serif;
/* ... other theme config */
}

After updating the configuration, run prebuild to apply the changes:

Terminal window
pnpm run prebuild

Then rebuild your app:

Terminal window
pnpm run ios # or pnpm run android

If you prefer to use local font files instead of npm packages:

Place your font files in the assets/fonts directory:

assets/fonts/
├── CustomFont-Regular.ttf
└── CustomFont-Bold.ttf

Reference the local font files in your configuration:

app.config.ts
plugins: [
[
'expo-font',
{
ios: {
fonts: [
'./assets/fonts/CustomFont-Regular.ttf',
'./assets/fonts/CustomFont-Bold.ttf',
],
},
android: {
fonts: [
{
fontFamily: 'CustomFont',
fontDefinitions: [
{
path: './assets/fonts/CustomFont-Regular.ttf',
weight: 400,
},
{
path: './assets/fonts/CustomFont-Bold.ttf',
weight: 700,
},
],
},
],
},
},
],
],
Terminal window
pnpm run prebuild
  • iOS: Font family names are automatically extracted from the font files
  • Android: You explicitly define the fontFamily name and weight mappings
  • Using this approach, you can use fontFamily: 'FontName' with fontWeight consistently across both platforms