Skip to content DS OneText Component | DS one
DS one

Text Component

The ds-text component provides consistent typography styles across your application.

<ds-text variant="body">This is some text</ds-text>

Large heading text:

<ds-text variant="heading">Main Heading</ds-text>

Standard body text:

<ds-text variant="body">This is body text for paragraphs.</ds-text>

Smaller text for captions or secondary information:

<ds-text variant="small">Small text for captions</ds-text>
AttributeTypeDefaultDescription
variant'heading' | 'body' | 'small''body'Text style variant
data-keystring-Translation key for i18n
<ds-text variant="heading" data-key="welcome"></ds-text>
<ds-text variant="body">
This text component supports multiple lines and will maintain proper spacing
and formatting.
</ds-text>

The component renders semantic HTML based on the variant:

  • heading<h1>, <h2>, etc.
  • body<p>
  • small<small>