Skip to content
TrademarkTrademark
Docs
Components

Text

Updated: October 18, 2026
View on GitHub

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.

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.

Colors

onBackground takes a scheme and a weight, such as "neutral-weak" or "brand-medium". Use onSolid for text on a solid background.

Alignment, truncation and spacing

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.

Differences from the web

  • 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.

Props

Text also takes the spacing props (padding, margin, their sides, gap) and every React Native Text prop.

Prop
Type
Default
Description
textVariantTextVariant"body-default-m"A type style such as "body-default-m".
family"body" | "heading" | "display" | "label" | "code"Swaps the preset's family and keeps its size and weight.
weight"default" | "normal" | "medium" | "strong"Swaps the preset's weight and keeps the rest.
onBackground"<scheme>-<weight>""neutral-strong"Text colour on a background.
onSolid"<scheme>-<weight>"Text colour on a solid surface. Wins over onBackground.
align"left" | "center" | "right" | "justify"Text alignment.
truncatebooleanOne line, ending in an ellipsis.
styleTextStyle | TextStyle[]Applied after the props.
Edit this page on GitHub