Text renders a React Native Text with a Once UI type style and colour. Set the style with one textVariant, such as "body-default-m"; family and weight swap its family and weight. Without any of them it is body-default-m in neutral-strong. See the web Text page for the full set of variants.
A variant is family-weight-size. The families are body, heading, display, label and code.
family and weight swap the preset's family and weight and keep its size, as in core. textVariant defaults to body-default-m.
onBackground takes a scheme and a weight, such as "neutral-weak" or "brand-medium". Use onSolid for text on a solid background.
align sets the text alignment. truncate keeps the text on one line and ends it with an ellipsis. React Native's numberOfLines works too. Text takes the spacing props, such as marginTop and paddingX.
- No as. React Native has no HTML elements. Use Heading for a title, which screen readers announce as a header.
- No wrap or opacity. Use numberOfLines to limit the lines, or pass a style.
- Nesting. A Text inside another Text runs inline with it, as in React Native.
Text also takes the spacing props (padding, margin, their sides, gap) and every React Native Text prop.