# Typography

> **Note:** The Siemens font is part of the official Siemens branding and must not be used in non-Siemens applications. Element uses a default font that is not associated with Siemens branding. Please note that the default theme is currently undocumented.

Typographic hierarchy is established through text size and color.

## Usage

For a cohesive typography experience, Element's type scale uses the Siemens Sans typeface. Hierarchy is communicated through differences in font weight (Roman and Semi bold) and size.

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './typography.html',
  host: { class: 'px-9 pt-9 background-1' }
})
export class SampleComponent {}
```

Template:

```html
<h1>H1 Heading</h1>
<h2>H2 Heading</h2>
<h3>H3 Heading</h3>
<h4>H4 Heading</h4>
<h5>H5 Heading</h5>
<h6>H6 Heading</h6>

<hr />

<p class="si-h1">H1 Heading</p>
<p class="si-h2">H2 Heading</p>
<p class="si-h3">H3 Heading</p>
<p class="si-h4">H4 Heading</p>
<p class="si-h5">H5 Heading</p>
<p class="si-h5-bold">H5 Heading Bold</p>
<p class="si-h6">H6 Heading</p>

<hr />

<p class="si-body-lg">Body Large</p>
<p class="si-body-lg-sbold">Body Large Semi Bold</p>
<p class="si-body">Body</p>
<p class="si-body-sbold">Body Semi Bold</p>
<p class="si-body-paragraph">Body Paragraph</p>
<p class="si-body-paragraph-sbold">Body Paragraph Semi Bold</p>
<p class="si-body-sm">Body Small</p>
<p class="si-body-sm-sbold">Body Small Semi Bold</p>

<hr />

<p><code class="si-code-lg">Code Large</code></p>
<p><code class="si-code">Code</code></p>
<p><code class="si-code-sm">Code Small</code></p>
```

### Best practices

- Respect the typographic scale order for consistent and hierarchical design.
- Consider the purpose and context of the text when selecting a type style. Headings, subheadings, and body text each serve distinct functions and should be chosen accordingly.
- Combine font weight, size, and color to establish hierarchy, utilizing lighter colors or smaller font sizes to de-emphasize secondary content.
- Avoid style changes like bold and italic in the middle of a paragraph.

## Design

Element’s typography is divided into body, headings, display, and code styles.

### Body

Body text is used for the main content, often following a heading or as part of UI components.

- Use `body` for most components and labels.
- Use `body-paragraph` for longer text blocks.
- Use `body-lg` for larger and more prominent text.
- Use `body-sm` for small, supportive text like annotations or metadata.

![Body fonts usage](<../images/typography-body-usage.png>)

| Style | Font size | Line height | Font weight |
| --- | --- | --- | --- |
| `body-lg` | 16 px | 20 px | 400 / Roman |
| `body` | 14 px | 16 px | 400 / Roman |
| `body-paragraph` | 14 px | 20 px | 400 / Roman |
| `body-sm` | 12 px | 16 px | 400 / Roman |

All body styles are also available in **semi bold** and *italic*. Semi bold is used to add emphasis or draw attention to key information, and is also applied in specific UI elements, such as button labels, or highlighted values in tables and lists.

Italic is used sparingly, for cases like technical terms.

### Headings

Headings communicate the structure and visual hierarchy of content on the page. They are defined semantically from `h1` to `h6`.

- Use `h1` for the largest headings.
- Use `h2` for main page headings.
- Use `h3` for section headings.
- Use `h4` for secondary section titles.
- Use `h5` for smaller content blocks such as cards or tertiary titles.
- Use `h5-bold` to emphasize smaller headings, such as unread notification titles.
- Use `h6` for the smallest heading level.

| Style | Font size | Line height | Font weight |
| --- | --- | --- | --- |
| `h1` | 28 px | 36 px | 600 / Semi Bold |
| `h2` | 24 px | 32 px | 600 / Semi Bold |
| `h3` | 20 px | 24 px | 600 / Semi Bold |
| `h4` | 16 px | 20 px | 600 / Semi Bold |
| `h5` | 14 px | 20 px | 600 / Semi Bold |
| `h5-bold` | 14 px | 20 px | 700 / Bold |
| `h6` | 12 px | 16 px | 600 / Semi Bold |

In order to adhere to [accessibility best practices](<https://www.w3.org/WAI/tutorials/page-structure/headings/>), each page should be structured according to the semantic hierarchy `h1`, `h2`, ... `h6`, starting from `h1` and maintaining a logical order without skipping levels.

Web browsers, plug-ins, and assistive technologies rely on this structure to provide in-page navigation. When visual requirements do not align with the semantic hierarchy, the appropriate HTML elements (`h1`, `h2`, ... `h6`) should still be used, with the desired visual style applied through CSS classes.

When the visual style of `h1` is too prominent for typical in-page headings, such as the [page header](<https://element.siemens.io/fundamentals/layouts/header/>), the `h2` style is used instead for visual balance.

In this pattern, the `h1` tag is assigned to the application name in the [application header](<https://element.siemens.io/components/layout-navigation/application-header/>). This preserves both visual hierarchy and correct semantic structure for assistive technologies.

![Headings accessibility semantics](<../images/typography-accesibility.png>)

#### Links

- [WCAG SC 2.4.10](<https://www.w3.org/WAI/WCAG22/Understanding/section-headings.html>)
- [WCAG technique G141](<https://www.w3.org/WAI/WCAG22/Techniques/general/G141>)
- [WCAG technique G69](<https://www.w3.org/WAI/WCAG22/Techniques/html/H69>)
- [WCAG tutorial page structure](<https://www.w3.org/WAI/tutorials/page-structure/>)

### Display

Display styles are used for high-impact content, such as hero sections, widgets, or dashboards. They should be used sparingly to maintain clarity.

![Display fonts usage](<../images/typography-display-usage.png>)

| Style | Font size | Line height | Font weight |
| --- | --- | --- | --- |
| `display-xxl` | 58 px | 72 px | 400 / Roman |
| `display-xl` | 48 px | 64 px | 400 / Roman |
| `display-lg` | 40 px | 52 px | 400 / Roman |
| `display` | 32 px | 40 px | 400 / Roman |

All display styles are also available in **semi bold**.

### Code

Code styles are used for technical content such as code samples, inline code, and other monospaced text. Use them when you need to present commands, snippets, file names, or other technical values.

![Code fonts usage](<../images/typography-code.png>)

| Style | Font size | Line height | Font weight |
| --- | --- | --- | --- |
| `code-lg` | 16 px | 20 px | 400 / Regular |
| `code` | 14 px | 20 px | 400 / Regular |
| `code-sm` | 12 px | 16 px | 400 / Regular |

### Using the bounding box

The vertical height of the text, known as the bounding box, is determined by the line-height. The value of the line-height is critical to make sure text aligns to the 8px grid.

Use the height of the bounding box together with top and bottom margin to determine spacing.

![Typography bounding box](<../images/typography-bounding-box.png>)

### Line length

Wide lines of text are harder to read; aim for 45-75 characters per line on desktop, and 30-45 on mobile for optimal readability.

![Typography line length](<../images/typography-line-length.png>)

### Color usage

Color is used in text to communicate information to the user. Color variants have meaning and are used to call attention to an action. The color of text must follow one of the [predefined color variants](<https://element.siemens.io/fundamentals/colors/ui-colors/>) and must not use any of the other defined colors.

See the [Text Colors](<https://element.siemens.io/fundamentals/colors/ui-colors/#text>) chapter.

## Code

Most scenarios allow you to use the HTML semantic element(s) (e.g. `h1`, `p`) directly, all the required styles are set by default.

In case you can't use the HTML semantic (*e.g. apply a text style to a non* *associated HTML tag*) or you have to use a type style without matching semantic, you can use the `.si-` text classes.

### Headings

Heading elements (`<h1>` through `<h6>`) are styled by default. For cases where you need heading-style typography but must use a different HTML element for semantic reasons, corresponding CSS classes are available.

```
<div class="si-h1">.si-h1 heading</div>
<div class="si-h2">.si-h2 heading</div>
<div class="si-h3">.si-h3 heading</div>
<div class="si-h4">.si-h4 heading</div>
<div class="si-h5">.si-h5 heading</div>
<div class="si-h5-bold">.si-h5-bold heading</div>
<div class="si-h6">.si-h6 heading</div>
```

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './headings.html',
  host: { class: 'p-5 d-flex gap-8' }
})
export class SampleComponent {}
```

Template:

```html
<div>
  <h1>h1 heading</h1>
  <h2>h2 heading</h2>
  <h3>h3 heading</h3>
  <h4>h4 heading</h4>
  <h5>h5 heading</h5>
  <h6>h6 heading</h6>
</div>
<div>
  <div class="si-h1 mb-4">.si-h1 visual style</div>
  <div class="si-h2 mb-4">.si-h2 visual style</div>
  <div class="si-h3 mb-4">.si-h3 visual style</div>
  <div class="si-h4 mb-4">.si-h4 visual style</div>
  <div class="si-h5 mb-4">.si-h5 visual style</div>
  <div class="si-h5-bold mb-4">.si-h5-bold visual style</div>
  <div class="si-h6">.si-h6 visual style</div>
</div>
```

### Body styles classes

Body styles can be applied using classes prefixed with `.si-body`. Each style also has a semi bold variant with the `-sbold` suffix.

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './body-styles.html',
  host: { class: 'p-5' }
})
export class SampleComponent {}
```

Template:

```html
<div class="si-body-lg mb-4">.si-body-lg body large</div>
<div class="si-body-lg-sbold mb-4">.si-body-lg-sbold body large semi bold</div>
<div class="si-body mb-4">.si-body body</div>
<div class="si-body-sbold mb-4">.si-body-sbold body semi bold</div>
<div class="si-body-paragraph mb-4">.si-body-paragraph body paragraph</div>
<div class="si-body-paragraph-sbold mb-4"> .si-body-paragraph-sbold body paragraph semi bold </div>
<div class="si-body-sm mb-4">.si-body-sm body small</div>
<div class="si-body-sm-sbold">.si-body-sm-sbold body small semi bold</div>
```

Use semantic elements such as `<strong>` and `<em>` when the emphasis has meaning. Use the `.fst-italic` utility when text only needs to be visually italicized.

### Display styles classes

Apply display typography using CSS classes prefixed with `.si-display-`. These classes mirror the display typography scale defined in the design system and can be applied to any element. Semi bold variants use the `-sbold` suffix.

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './display-styles.html',
  host: { class: 'p-5' }
})
export class SampleComponent {}
```

Template:

```html
<div class="si-display-xxl mb-4">.si-display-xxl display extra extra large</div>
<div class="si-display-xxl-sbold mb-4">
  .si-display-xxl-sbold display extra extra large semi bold
</div>
<div class="si-display-xl mb-4">.si-display-xl display extra large</div>
<div class="si-display-xl-sbold mb-4">.si-display-xl-sbold display extra large semi bold</div>
<div class="si-display-lg mb-4">.si-display-lg display large</div>
<div class="si-display-lg-sbold mb-4">.si-display-lg-sbold display large semi bold</div>
<div class="si-display mb-4">.si-display display</div>
<div class="si-display-sbold">.si-display-sbold display semi bold</div>
```

### Code styles classes

Use the code style classes for technical values that require the monospaced typeface. Prefer semantic `<code>` or `<pre>` elements when presenting code.

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './code-styles.html',
  host: { class: 'p-5' }
})
export class SampleComponent {}
```

Template:

```html
<code class="si-code-lg d-block mb-4">.si-code-lg code large</code>
<code class="si-code d-block mb-4">.si-code code</code>
<code class="si-code-sm d-block">.si-code-sm code small</code>
```

### Lead

Use the `.lead` class to make a paragraph visually prominent with larger text. This is typically used for introductory paragraphs or to emphasize key content at the beginning of a section.

```
<p class="lead">
  Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non
  commodo luctus.
</p>
```

### Inline text elements

Use these tags for semantic purposes:

| Semantic element | Alternative style | Description |
| --- | --- | --- |
| `<mark>` | `.mark` | Represents text which is marked or highlighted for reference or notation purposes. |
| `<del>` |  | Represents a range of text that has been deleted from a document. |
| `<ins>` |  | Represents a range of text that has been added to a document. |
| `<s>` | `.text-decoration-line-through` | Represents elements that are no longer relevant or no longer accurate. |
| `<u>` | `.text-decoration-underline` | Represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation. |
| `<small>` | `.small` | Represents side-comments and small print, like copyright and legal text. |
| `<strong>` | `.fw-bold` | Represents a bold text. |
| `<em>` | `.fst-italic` | Represents text rendered as italicized text. |

While not shown above, feel free to use `<b>` and `<i>` in HTML5. `<b>` is meant to highlight words or phrases without conveying additional importance, while `<i>` is mostly for voice, technical terms, etc.

```
<p>You can use the mark tag to <mark>highlight</mark> text.</p>
<p><del>This line of text is meant to be treated as deleted text.</del></p>
<p><s>This line of text is meant to be treated as no longer accurate.</s></p>
<p><ins>This line of text is meant to be treated as an addition to the document.</ins></p>
<p><u>This line of text will render as underlined.</u></p>
<p><small>This line of text is meant to be treated as fine print.</small></p>
<p><strong>This line is rendered as bold text.</strong></p>
<p><em>This line is rendered as italicized text.</em></p>
```

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './inline-elements.html',
  host: { class: 'p-5' }
})
export class SampleComponent {}
```

Template:

```html
<p>You can use the mark tag to <mark>highlight</mark> text.</p>
<p><del>This line of text is meant to be treated as deleted text.</del></p>
<p><s>This line of text is meant to be treated as no longer accurate.</s></p>
<p><ins>This line of text is meant to be treated as an addition to the document.</ins></p>
<p><u>This line of text will render as underlined.</u></p>
<p><small>This line of text is meant to be treated as fine print.</small></p>
<p><strong>This line is rendered as bold text.</strong></p>
<p><em>This line is rendered as italicized text.</em></p>
```

### Text utilities

Change text alignment, colors, decoration, line-height, style, transform and weight with our [text utilities](<https://element.siemens.io/fundamentals/styles/text/>) and [text color](<https://element.siemens.io/fundamentals/styles/colors/>) classes.

### Typography specification

Font families, font sizes, line heights, and font weights are available as system-token SASS variables in the form `$si-sys-typography-[name]-[property]`. They reference CSS custom properties, with font sizes and line heights adapting to the active density.

```
@use '@siemens/element-theme/src/styles/variables';

font-size: variables.$si-sys-typography-h1-font-size;
line-height: variables.$si-sys-typography-h1-line-height;
font-weight: variables.$si-sys-typography-h1-font-weight;
```

We use the specifications for defining the style CSS classes and for configuring Element's typography system.

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './semantic-elements.html',
  host: { class: 'p-5' }
})
export class SampleComponent {}
```

Template:

```html
<h2>Customizing headings</h2>
<h3>
  Fancy display heading
  <small class="text-secondary">With faded secondary text</small>
</h3>
<hr />

<h2>Display headings</h2>
<h1 class="display-1">Display 1</h1>
<h1 class="display-2">Display 2</h1>
<h1 class="display-3">Display 3</h1>
<h1 class="display-4">Display 4</h1>
<hr />

<h2>Lead</h2>
<p class="lead">
  Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non
  commodo luctus.
</p>
<hr />

<h2>Inline text elements</h2>
<p>You can use the mark tag to <mark>highlight</mark> text.</p>
<p><del>This line of text is meant to be treated as deleted text.</del></p>
<p><s>This line of text is meant to be treated as no longer accurate.</s></p>
<p><ins>This line of text is meant to be treated as an addition to the document.</ins></p>
<p><u>This line of text will render as underlined.</u></p>
<p><small>This line of text is meant to be treated as fine print.</small></p>
<p><strong>This line is rendered as bold text.</strong></p>
<p><em>This line is rendered as italicized text.</em></p>
<hr />

<h2>Blockquotes</h2>
<blockquote class="blockquote">
  <p>A well-known quote, contained in a blockquote element.</p>
</blockquote>

<h3>Naming a source</h3>
<figure>
  <blockquote class="blockquote">
    <p>A well-known quote, contained in a blockquote element.</p>
  </blockquote>
  <figcaption class="blockquote-footer">
    Someone famous in <cite title="Source Title">Source Title</cite>
  </figcaption>
</figure>

<h3>Alignment</h3>
<figure class="text-center">
  <blockquote class="blockquote">
    <p>A well-known quote, contained in a blockquote element.</p>
  </blockquote>
  <figcaption class="blockquote-footer">
    Someone famous in <cite title="Source Title">Source Title</cite>
  </figcaption>
</figure>
<hr />

<h2>Lists</h2>
<h3>Unstyled</h3>
<ul class="list-unstyled">
  <li>Lorem ipsum dolor sit amet</li>
  <li>Consectetur adipiscing elit</li>
  <li>Integer molestie lorem at massa</li>
  <li>Facilisis in pretium nisl aliquet</li>
  <li
    >Nulla volutpat aliquam velit
    <ul>
      <li>Phasellus iaculis neque</li>
      <li>Purus sodales ultricies</li>
      <li>Vestibulum laoreet porttitor sem</li>
      <li>Ac tristique libero volutpat at</li>
    </ul>
  </li>
  <li>Faucibus porta lacus fringilla vel</li>
  <li>Aenean sit amet erat nunc</li>
  <li>Eget porttitor lorem</li>
</ul>

<h3>Inline</h3>
<ul class="list-inline">
  <li class="list-inline-item">Lorem ipsum</li>
  <li class="list-inline-item">Phasellus iaculis</li>
  <li class="list-inline-item">Nulla volutpat</li>
</ul>

<h3>Description list alignment</h3>
<dl class="row mx-0">
  <dt class="col-sm-3">Description lists</dt>
  <dd class="col-sm-9">A description list is perfect for defining terms.</dd>

  <dt class="col-sm-3">Euismod</dt>
  <dd class="col-sm-9">
    <p>Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.</p>
    <p>Donec id elit non mi porta gravida at eget metus.</p>
  </dd>

  <dt class="col-sm-3">Malesuada porta</dt>
  <dd class="col-sm-9">Etiam porta sem malesuada magna mollis euismod.</dd>

  <dt class="col-sm-3 text-truncate">Truncated term is truncated</dt>
  <dd class="col-sm-9"
    >Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa
    justo sit amet risus.</dd
  >

  <dt class="col-sm-3">Nesting</dt>
  <dd class="col-sm-9">
    <dl class="row">
      <dt class="col-sm-4">Nested definition list</dt>
      <dd class="col-sm-8">Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc.</dd>
    </dl>
  </dd>
</dl>
```
