Foundational text primitive.
This component is based on the span element and supports common margin props.
Use the as prop to render text as a p, label, div or span. This prop is purely semantic and does not alter visual appearance.
Use the size prop to control text size. This prop also provides correct line height and corrective letter spacing—as text size increases, the relative line height and letter spacing decrease.
Sizes 2–4 are designed to work well for long-form content.
Sizes 1–3 are designed to work well for UI labels.
Use the weight prop to set the text weight.
Use the align prop to set text alignment.
Use the trim prop to trim the leading space at the start, end, or both sides of the text box.
The prop works similarly to the upcoming half-leading control spec, but uses a common negative margin workaround under the hood for cross-browser support.
Trimming the leading is useful when dialing in vertical spacing in cards or other “boxy” components. Otherwise, padding looks larger on top and bottom than on the sides.
The default trim values are configured for the system font stack that’s used by Radix Themes. If you are using custom fonts, you can adjust the trim values using the corresponding CSS variables.
Use the truncate prop to truncate text with an ellipsis when it overflows its container.
Use the wrap prop to control text wrapping.
text-wrap: pretty is an experimental value that is not yet supported in all browsers. However, it can be treated as a progressive enhancement for browsers that do support it.
Use the color prop to assign a specific color. The text colors are designed to achieve at least Lc 60 APCA contrast over common background colors.
Use the highContrast prop to increase color contrast with the background.
Compose Text with formatting components to add emphasis and structure to content.
Composing Text with a form control like Checkbox, RadioGroup, or Switch automatically centers the control with the first line of text, even when the text is multi-line.