Overview
TheFonts constant provides platform-specific font families that adapt automatically based on the runtime environment. It uses React Native’s Platform.select() to deliver optimized font stacks for iOS, Android, and Web platforms.
Import
Font Families
iOS Fonts
On iOS, the fonts map to nativeUIFontDescriptor system designs:
iOS
UIFontDescriptorSystemDesignDefault - Default system fontiOS
UIFontDescriptorSystemDesignSerif - Serif system fontiOS
UIFontDescriptorSystemDesignRounded - Rounded system font (SF Pro Rounded)iOS
UIFontDescriptorSystemDesignMonospaced - Monospaced system fontAndroid/Default Fonts
On Android and other platforms, fonts use standard CSS font family values:Default sans-serif font
Default serif font
Falls back to default font (no native rounded font on Android)
Default monospaced font
Web Fonts
On web platforms, fonts use comprehensive fallback stacks:System font stack for sans-serif text
Classic serif font stack
Rounded font stack with Japanese font support
Developer-friendly monospace font stack
Usage Examples
Basic Usage
Use fonts in your StyleSheet definitions:Inline Styles
Platform-Specific Styling
Combine with Platform-specific styles for fine-grained control:Typography System
Create a reusable typography system:Type Definition
Fonts is determined at runtime based on the platform using Platform.select().
Best Practices
Use Consistent Font Families
Stick to the four provided font families (sans, serif, rounded, mono) throughout your app for visual consistency.
Test Across Platforms
Font rendering can vary significantly between iOS, Android, and Web. Always test your text styles on all target platforms.
Combine with Font Weights
Use
fontWeight in combination with font families for proper typographic hierarchy.Consider Accessibility
Ensure your font sizes and line heights maintain readability. Minimum recommended font size is 14px for body text.
Platform Notes
iOS
- Uses native SF Pro font family
roundedprovides the beautiful SF Pro Rounded- All system fonts support Dynamic Type
Android
- Uses Roboto as the default system font
roundedfalls back to normal since Android doesn’t have a native rounded font- Consider using custom fonts if you need rounded typography on Android
Web
- Provides comprehensive fallback stacks
- System fonts load instantly without font file downloads
- Ensures consistent rendering across browsers
Related
- Colors - Theme-aware color constants
- Theming Guide - Best practices for text styling
- Platform Module - React Native Platform API