React

Text

A basic typography component for displaying text. It is used to render text with consistent font styles and sizes.

Usage

import { Text } from "@seed-design/react";
<Text />

Props

Prop

Type

Examples

Text Styles

The basic approach is to use the textStyle attribute that corresponds to Figma's Text Style. textStyle sets font size, line height, and font weight all at once.

Font Sizes

If more specific changes are needed, you can use the fontSize and lineHeight attributes respectively.

The lineHeight attribute is set to a default value corresponding to fontSize and can be changed using the lineHeight attribute.

Font Weights

If more specific changes are needed, you can use the fontWeight attribute.

Text Decoration Lines

You can add underline or strikethrough to text using the textDecorationLine attribute.

Before using textDecorationLine="underline"
  • When applying underline to emphasize non-link text, you should consider user experience. Underlined text may be perceived as a link, so it should only be used in appropriate situations to avoid confusion.
  • If you want to use inline text as a link outside the body area, consider using ActionButton with variant="ghost" bleedX="asPadding" bleedY="asPadding" options.

Max Lines

You can limit the maximum number of lines that text occupies using the maxLines attribute. Text exceeding the specified number of lines is displayed with an ellipsis ….

User Select

You can control whether users can select text using the userSelect attribute.

Static

You can apply text styles using static tokens that do not respond to font scaling.

White Space

The whiteSpace prop is only applied when the maxLines prop is not used.

Table of contents