string
required
URL to the font file. Supports
.ttf and .otf formats.string
required
The font family name, as defined in the font file metadata.
number
required
Font size in points.
string
A semantic text style (e.g.
"body", "headline") to scale the font size relative to. Only the web renderer reads it. On iOS, the font scales with Dynamic Type relative to the text style closest to size, whether or not this prop is set.Support
Usage
Basic custom font
With Dynamic Type scaling
Multiple weights
Notes
- The font file must be accessible from the provided URL at runtime.
- Supported formats are
.ttfand.otf. CustomFontreturns aFontComponentthat is passed to the.font()modifier, not used as a standalone view.- On iOS, the font size scales with the user’s Dynamic Type setting whether or not
relativeToTextStyleis set. Only the web renderer readsrelativeToTextStyle.
See Also
- Text — text display