Skip to content

Text API

import { Text } from '@cimpress-ui/react';

Text rendered within other text will inherit its parent’s style.

The example below renders multiple levels of nested Text components. Notice how each nested text has the same style as its parent, even though it’s not specified in the markup.

This is a single paragraph of text. But it can contain many different styles within it.

Renders the provided text contents in a specified style.

See typography guide.

Ref<ElementRef<T>>

The ref type for this component.

TextProps<T extends TextElement>
T

The HTML element to render as.

ReactNode

Text to display. Allows nesting other typography components.

string

The element's unique identifier. See MDN.

boolean

Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.

string

Sets the CSS className for the element. Only use as a last resort. Use style props instead.

See styling guide.

CSSProperties

Sets the CSS style for the element. Only use as a last resort. Use style props instead.

See styling guide.

string

Defines a string value that labels the current element.

string

Identifies the element (or elements) that labels the current element.

string

Identifies the element (or elements) that describes the object.

string

Identifies the element (or elements) that provide a detailed, extended description for the object.

'small' | 'medium' | 'title-1' | 'title-2' | 'title-3' | 'title-4' | 'title-5' | 'title-6' | 'body' | 'body-semibold' | 'medium-semibold' | 'small-semibold'

Determines the visual variant of text.

'normal' | 'italic'

Whether the font should be styled with a normal or italic face.

'center' | 'end' | 'start' | 'justify'

Horizontal alignment of text.

'none' | 'underline' | 'strikethrough'

The kind of decorative line applied to the text.

ForegroundTone

Determines the color tone of the text.

StyleProps
Responsive<Spacing | "auto">

The amount of margin applied to all edges of this component.

Responsive<Spacing | "auto">

The amount of margin applied to the left and right edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top and bottom edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the right edge of this component. Takes priority over marginX and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the bottom edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the left edge of this component. Takes priority over marginX and margin.