Skip to contentSkip to navigationSkip to topbar
Paste assistant Assistant
Figma
Star

Text

Version 10.1.1GithubStorybook

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.

Installation

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">
    Foo
  </Text>
);

Text

Text page anchor

as RequiredRequired

Controls the HTML element that that will be rendered in the DOM.

Type
keyof IntrinsicElements

_active

Type
TextStyleProps

_after

Type
TextStyleProps

_before

Type
TextStyleProps

_checked

Type
TextStyleProps

_disabled

Type
TextStyleProps

_even

Type
TextStyleProps

_expanded

Type
TextStyleProps

_first

Type
TextStyleProps

_focus

Type
TextStyleProps

_focusWithin

Type
TextStyleProps

_grabbed

Type
TextStyleProps

_hover

Type
TextStyleProps

_invalid

Type
TextStyleProps

_last

Type
TextStyleProps

_mixed

Type
TextStyleProps

_notFirst

Type
TextStyleProps

_notLast

Type
TextStyleProps

_odd

Type
TextStyleProps

_pressed

Type
TextStyleProps

_readOnly

Type
TextStyleProps

_selected

Type
TextStyleProps

_selected_focus

Type
TextStyleProps

_selected_focusVisible

Type
TextStyleProps

_selected_hover

Type
TextStyleProps

_visited

Type
TextStyleProps

content

Sets the CSS content property

Type
string

cursor

Style prop of CSS cursor value

Type
any

dateTime

Same as HTML

Type
string

display

Responsive style prop of CSS display values

Type
any

element

Used to set a custom element name for customization.

Type
string

href

Same as HTML

Type
string

outline

Style prop of CSS outline value

Type
any

rel

Same as HTML

Type
string

target

Same as HTML

Type
string

transition

Style prop of CSS transition value

Type
any

transitionDelay

Style prop of CSS transition-delay value

Type
any

variant

Used to style custom variants via customization.

Type
string

verticalAlign

Responsive style prop of CSS vertical-align values

Type
any