Skip to main content

Text

The text component displays inline text with specific visual styles or tones. Use text to emphasize or differentiate words or phrases within paragraphs or other block-level components, applying weight, color, or semantic styling.

Text supports multiple visual variants, tone, and color options for flexible inline typography control. For block-level text content, use paragraph.

Text is inline by default — wrapping it around block-level content might cause unexpected layout behavior.

Support
Targets (24)

Configure the following properties on the text component.

Anchor to accessibilityVisibility
accessibilityVisibility
'visible' | 'hidden' | 'exclusive'
Default: 'visible'

Changes the visibility of the element.

  • visible: the element is visible to all users.
  • hidden: the element is removed from the accessibility tree but remains visible.
  • exclusive: the element is visually hidden but remains in the accessibility tree.
Anchor to color
color
'base' | 'subdued'
Default: 'base'

Modify the color to be more or less intense.

'ltr' | 'rtl' | 'auto' | ''
Default: ''

Indicates the directionality of the element’s text.

  • ltr: languages written from left to right (such as English)
  • rtl: languages written from right to left (such as Arabic)
  • auto: the user agent determines the direction based on the content
  • '': direction is inherited from parent elements (equivalent to not setting the attribute)
Anchor to display
display
<"auto" | "none">
Default: 'auto'

Sets the outer display type of the component. The outer type sets a component’s participation in flow layout.

  • auto: the component’s initial value. The actual value depends on the component and context.
  • none: hides the component from display and removes it from the accessibility tree, making it invisible to screen readers.
string

A unique identifier for the element. Use this to reference the element in JavaScript, link labels to form controls, or target specific elements for styling or scripting.

string
Default: ''

Indicate the text language. Useful when the text is in a different language than the rest of the page. It will allow assistive technologies such as screen readers to invoke the correct pronunciation. Reference of values (Subtag label)

It is recommended to combine it with the dir attribute to ensure the text is rendered correctly if the surrounding content’s direction is different.

'info' | 'auto' | 'neutral' | 'success' | 'warning' | 'critical' | 'custom'
Default: 'auto'

Sets the tone of the component, based on the intention of the information being conveyed.

'address' | 'mark' | 'small' | 'strong' | 'generic' | 'redundant' | 'emphasis' | 'offset'
Default: 'generic'

Provide semantic meaning and default styling to the text.

Other presentation properties on Text override the default styling.


Anchor to Display subdued textDisplay subdued text

Display subdued security text near account pages. This example renders an s-text with type="small" and color="subdued" for a security reassurance message.

Display subdued text

A span of inline text rendered in the default body font style.

html

<s-text type="small" color="subdued">
All transactions are secure and encrypted.
</s-text>

Anchor to Emphasize important informationEmphasize important information

Apply strong emphasis and neutral tone to informational text. This example sets type="strong" with tone="neutral" for policy copy that shouldn't read as success or warning.

html

<s-text type="strong" tone="neutral">
By placing this order, you agree to our terms of sale.
</s-text>

Anchor to Mix regular and strong text in one lineMix regular and strong text in one line

Pair a label with emphasized values inside the same sentence. This example places two s-text elements inline, one default and one with type="strong".

html

<s-text type="strong">Total: </s-text><s-text>$49.99</s-text>

  • Apply tone intentionally: Set tone to convey semantic meaning like success or warning rather than using color alone.
  • Keep inline text short: Use s-text for words or phrases, not full paragraphs. For block-level content, use s-paragraph.

Was this page helpful?