Text renders a React Native Text with a Once UI type style and colour. Set the style with one variant, such as "body-default-m", or with family, size 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.
When variant is not set, family, size and weight build one. They default to body, m and default.
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.