2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Components

Text

Updated: June 30, 2026
View on GitHub
The Text component provides consistent typography throughout your UI, with support for variants, color tokens, alignment, and spacing. It is typically used for body content, labels, descriptions, and captions. Use variant to apply a named combination of type, weight, and size. You can override the default font-family that comes with the variant with the family prop. You can override the default font-weight inside a variant with the weight prop. Text color can be set using onBackground or onSolid. Control text visibility with the opacity prop, accepting values from 0 to 100. Set horizontal alignment with the align prop. Control how the text wraps using the wrap prop. Use margin and padding props to control layout spacing. Control the rendered tag using the as prop.
Prop
Type
Default
as
ElementType"span"
variant
TextVariant
size
xssmlxl
weight
defaultstrong
family
displayheadingbodylabelcode
onBackground
`${ColorScheme}-${ColorWeight}`
onSolid
`${ColorScheme}-${ColorWeight}`
opacity
Opacity100
align
leftcenterrightjustify
wrap
normalnowrapbalance
truncate
boolean
padding
SpacingTokennumber
paddingX
SpacingTokennumber
paddingY
SpacingTokennumber
paddingLeft
SpacingTokennumber
paddingRight
SpacingTokennumber
paddingTop
SpacingTokennumber
paddingBottom
SpacingTokennumber
margin
SpacingTokennumber
marginX
SpacingTokennumber
marginY
SpacingTokennumber
marginLeft
SpacingTokennumber
marginRight
SpacingTokennumber
marginTop
SpacingTokennumber
marginBottom
SpacingTokennumber
children
React.ReactNode
className
string
style
React.CSSProperties
…and every React.HTMLAttributes propinherited
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club