Skip to content
Change the site theme


A primitive component that can be used to create all text styles in Paste


Guidelines page anchor
Information icon

Please note

Only use this component if all other Paste typographic components don’t meet your use case. If you find yourself here, come to the Design System Office Hours.

The Text component is a primitive of the system and can output any supported text style provided by our design tokens. Coupled with Box, it underpins most of our components.

About Text

About Text page anchor

The Text component is a design primitive. It is designed to be used when other typographic components in Paste do not meet your requirements. It is a styled component that allows you to create text styles with values from our design tokens. When using the Text component you can create any type of UI text and always be using the Twilio design language.

The Text component allows you to set style properties for common text styles. These properties include font family, color and line-height. You can only select design tokens as the value of each property. You can use any combination of the different properties, though.

Style properties on the Text component can be set with a single value or a responsive value. By setting a responsive value, you can control how your text will appear at each breakpoint the theme(link takes you to an external page) supports. This can be useful in supporting responsive designs for different screen sizes.

Via the as property, you can also set the Text component to render as any HTML element.

The Text component can be used in any situation. As always, when working with HTML you need to make a careful choice to select an appropriate semantic for your text. That semantic communicates the intended meaning of that text to assistive technology.

Information icon

Be sure to use the "as" prop to select semantically meaningful HTML elements. The "as" property is required. As a fallback, the Text component will render as a span which may not be suitable for your use-case.

You can set an array of values to any style property supported by the Text component. By providing an array of styles you can declare how the text should appear for each breakpoint. You can provide as many styles as there are breakpoints supported by the theme. Each style you provide in the array will match a breakpoint in the theme object, based on the same order.

Tokens as pseudo-class props

Tokens as pseudo-class props page anchor

To view the full list of pseudo-class props, check the props table.

There are many pre-styled text components in Paste. For example, Heading, Paragraph and InputLabel. You should use those components wherever possible. Only when your use case cannot be met by these components should you reach for the Text component.

The best use case for the Text component is when you are working with a design partner and are creating a net new experience not already covered by Paste. The Text component will be the easiest way to recreate your new experience using the Twilio design language.


Explore what’s in Paste that will meet your needs first. For example, the Paragraph and Heading components


Don’t reach for the Text component as your first option


Use the Text component to create entirely new experiences not covered by Paste


Don’t use the Text Component to recreate a slightly different version of a pre-existing Paste component


Use the Text component for all styled text that doesn’t already exist in Paste


Don’t use base HTML elements for your text since there are no global styles


Always set the “as” property to ensure you are making a suitable semantic choice


Don’t use the Text component without setting the “as” property


Installation page anchor
yarn add @twilio-paste/text - or - yarn add @twilio-paste/core
import {Text} from '@twilio-paste/text';
const Component = () => (
<Text as="p" fontSize="fontSize70" fontWeight="fontWeightMedium">

All the regular HTML attributes (role, aria-*, type, and so on) including the following custom props:

as?keyof JSX.IntrinsicElementsA custom HTML tagdiv
fontFamily?ResponsiveValue<keyof ThemeShape[fonts]>
fontSize?ResponsiveValue<keyof ThemeShape[fontSizes]>
fontWeight?ResponsiveValue<keyof ThemeShape[fontWeights]>
lineHeight?ResponsiveValue<keyof ThemeShape[lineHeights]>
margin?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
marginTop?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
marginRight?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
marginBottom?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
marginLeft?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
padding?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
paddingBottom?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
paddingLeft?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
paddingRight?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
paddingTop?ResponsiveValue<keyof ThemeShape['space']>One of our spacing tokens
color?ResponsiveValue<keyof ThemeShape['textColors']>

Black lives matter.