---
title: Examples
slug: wip/XTYi-examples
createdAt: 2023-07-20T14:45:03.180Z
---

# Examples

:::hint{type="warning"}
**☝️ Watch Out**

Displaying Titles requires the related font face definitions to be loaded.

Find out how to embed [Font Faces](https://cosmos.redbull.design/wip/font-faces)
:::

## Basic usage

To render a Title in a specific variant, provide values to properties according to the API documentation.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/8ad6560c3d06ccb2e777a2b1e0100265?defaultTab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;299px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Alignment

The CSS `text-align` is one of the few styles that are inherited by text nodes inside web components. Setting an alignment on a Title component or any of its parents will allow controlling the horizontal alignment of its content.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/MWPKZLo/7c147d784925d2daa0db503703e8ad74?defaultTab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;386px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Spacing and Vertical Rhythm

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/afcdf820d47704af7fce76ff8a147bb9?defaultTab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;678px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Change the appearance

By default, the Title adapts to a light mode environment by appearing dark. When in a dark mode environment, the Title should appear light instead.

The appearance of a Title can be set using the appearance property or by nesting it into a cosmos-mode component. Read more about the [Mode & Appearance](https://cosmos.redbull.design/wip/mode-and-appearance) concept.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/35e314df0b69693242e2d5ac1825532f?defaultTab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;532px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Breakpoint specific sizes

Text supports setting different sizes specific for different [Breakpoint](https://cosmos.redbull.design/wip/breakpoint). The supported pattern is a **size followed by breakpoint** with both values being separated by an `@`.

Multiple value pairs can be provided by separating them with an empty space.

`size="x-large@small small@medium x-small@large"`

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/0118939dffa06ad44c68ced7663a06f0?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;360px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

💡 Try looking at [this example](https://codepen.io/redbulldesign/live/0118939dffa06ad44c68ced7663a06f0) in different viewport sizes to see the responsive property in action.

## Clamping

The `clamp` property is used to truncate the title after a specified number of lines, or to a single line when set to `true`.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/ZEKBWwd/cd65b46acd6021fc1e80a58d86700a2e?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;360px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

