React Native · Components
Text
Text in the theme color and the library's type scale.
4 exports
Import
Text
componentText in the theme color and the library's type scale. Headings (h1–h4) are reported to screen readers as headings. Variant sizes scale with the device (UIProvider scaling); numbers you give in style stay as is (scale them with useScale().fs() or createStyles).
Examples
TextVariant
typeText style; sizes match the Tailwind scale on web.
body: 16/24 (readable body text on mobile).sm: 14/20.xs: 12/16.lg: 18/28.h130/36 bold,h224/32 semibold,h320/28 semibold,h418/28 semibold.label: 14/20 medium (form label).
TextTone
typeText color: one of the theme colors.
TextProps
interfaceText props.
Extends: NativeTextProps
| Name | Type | Default | Description |
|---|---|---|---|
ref? | Ref<TextRef> | Ref of the underlying native element. | |
variant? | TextVariant | "body" | Style. See TextVariant. |
tone? | TextTone | "default"` (theme `foreground`) | Color. |
weight? | FontWeightInput | Weight; overrides the style's weight. For fonts with a file per weight (e.g. inter) the right file is chosen; fontWeight / fontStyle: "italic" inside style resolve the same way. | |
italic? | boolean | Italic text (the font's italic file is used if it has one). | |
align? | TextStyle["textAlign"] | Alignment. |