Text

Displays a basic text primitive.

No props data available for Text.

Use the as prop to render text as a div or paragraph. This prop is purely semantic and does not change the visual appearance of the text.

Use the color prop to control the color of the text. The colors are accessible over the canvas color and over steps 1 and 2 of the color scales.

Use the highContrast prop to use the highest contrast variant of the text color.

Use the align prop to set text alignment. You can change the alignment across breakpoints using the object syntax.

Use the size prop to control the size of the text. The prop also provides correct line height and corrective letter spacing – as text size increases, the relative line height and letter spacing decrease.

You can change the size across breakpoints using the object syntax.

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 trim prop to trim the leading space at the start, end, or both sides of the text box. You can change the leading trim across breakpoints using the object syntax.

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, the card padding looks larger on top and bottom than on the sides.

Use the weight prop to set the weight of the text. You can change the weight across breakpoints using the object syntax.

Text component works in tandem with WorkDS formatting components.

Context

Usage

Used 2489 times across 2 packages

Dashboard
2163
Admin Portal
326

Variant Distribution

align

center
86%
right
11%
left
3%

color

gray
74%
red
25%
green
0%
purple
0%
yellow
0%

size

1
10%
2
82%
3
5%
4
1%
5
1%
6
1%
7
0%
8
0%
9
0%

weight

bold
83%
medium
13%
regular
3%
light
1%

wrap

nowrap
85%
pretty
15%

trim

both
73%
start
16%
end
11%

truncate

true
100%

highContrast

true
100%

Where it's used

605 files

packages/dashboard/src/components/billing/invoice-card.stories.tsx64
packages/dashboard/src/components/get-started/get-started.tsx30
packages/dashboard/src/legacy-pages/settings/billing.tsx28
packages/dashboard/src/components/authentication/configure-email-password-dialog.tsx25
packages/dashboard/src/components/emails/providers/configure-custom-email-provider-dialog.tsx25
packages/dashboard/src/components/emails/providers/manage-custom-email-provider-dialog.tsx25
packages/dashboard/src/components/log-streams/log-stream-destination-azure-sentinel.tsx24
packages/dashboard/src/components/log-streams/log-stream-destination-s3.tsx24

/branding/edit

packages/dashboard/src/app/(private)/(chromeless)/branding/edit/edit-branding.tsx27

/p/:portalSessionId/sso/:connectionId/verification/failed/:sessionId

packages/admin-portal/src/app/p/[portalSessionId]/sso/[connectionId]/verification/failed/[sessionId]/session-error-callout.tsx20

Show 595 more files