On this page
Text
Themeable body copy with size and color variants. Renders a p, or the render element. Defaults can come from TextContext.
Use for
- body copy or a paragraph
- secondary or muted text
- inline copy inside other text, with
render
Practices
| Guidance | Practice |
|---|---|
| Do | Pass render={<span />} for inline copy. |
| Do | Use color='foreground-secondary' for muted copy instead of an xstyle color. |
API reference
Text
Renders a p and forwards its ref. Carries data-size and data-color.
Slot: cl-text
| Prop | Type | Description |
|---|---|---|
size | TypographySize | xs, sm, base, lg, xl or 2xl.Default: 'sm' |
color | TypographyColor | foreground, foreground-secondary, brand, warning, negative or positive.Default: 'foreground' |
Examples
Body copy
<Text>{description}</Text>Inline muted copy
<Text render={<span />} color='foreground-secondary'>{email}</Text>