If you answer yes, we store and analyse information that helps us improve the website. You can change your choice at any time at the bottom of the page. More about what we store and why.

We also store necessary information that cannot be opted out of. This makes the website work and keeps it secure.

Skip to main content

What are you looking for?

Try searching for…

Components

Heading

Heading is used to structure content and create hierarchy on a page.

Press Enter to start editing
<h2 class="ds-heading">This is a heading</h2>
const PreviewEn = () => {
  return <Heading>This is a heading</Heading>;
};

render(<PreviewEn />)

Usage

Use the class name ds-heading to style an HTML <h1>-<h6> element.

Example

Sizes

React

Heading

level
Description

Heading level. This will translate into any h1-6 level unless `asChild` is `true`

Type
1 | 2 | 3 | 4 | 5 | 6
Default
2
asChild
Description

Change the default rendered element for the one passed as a child, merging their props and behavior.

Type
boolean
Default
false
NameTypeDefaultDescription
level1 | 2 | 3 | 4 | 5 | 62

Heading level. This will translate into any h1-6 level unless `asChild` is `true`

asChildbooleanfalse

Change the default rendered element for the one passed as a child, merging their props and behavior.

Edit this page on github.com (opens in a new tab)