TrademarkTrademark
Docs
Ctrl k
Search docs...
Components

Text

Updated: October 18, 2026
View on GitHub
Soon
Not released yet. This is on main and is not in any published version yet. It will not install today.

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.

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.

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
variantTextVariantA type style such as "body-default-m". Wins over family, size and weight.
family"body" | "heading" | "display" | "label" | "code""body"Used when variant is not set.
size"xs" | "s" | "m" | "l" | "xl""m"Used when variant is not set.
weight"default" | "normal" | "medium" | "strong""default"Used when variant is not set.
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
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club