---
title: Heading
description: Use the heading component to render title or subtitle text
keywords: ['title', 'subtitle']
---

![An image displaying each header from h1 to h6.](https://github.com/primer/brand/assets/912236/9947878f-4d2f-439f-ab6e-8349115f6888)

## Usage

Headings are used to structure the content on the page, with each heading representing a different level of importance. It is recommended to use headings in a logical manner to create a clear hierarchy and improve accessibility.

- Heading should be used to communicate page organization and hierarchy.
- Use heading as the title that introduces a page, a section or an article.
- The heading component will render an html h2 tag without any default styling.

## Options

### Scale and size

The heading scale ranges from 1 to 6 and maps to the HTML heading elements h1 to h6 respectively. The size is determined by the type of HTML element specified, although you can override this when the scenario calls for it. E.g. use a `h2` heading size on a `<h3>` to highlight an article that might be relevant to the user.

### Weight, stretch and letter spacing

The heading component also supports the following options: `weight`, `stretch` and `letterSpacing`. Each of these options are determined by the heading scale and size, but can be overridden when the scenario calls for it.

### Responsive

The heading component is responsive by default and the size will scale down on smaller screens. Weight, stretch and letter spacing will remain the same across all screen sizes but can be overridden for each breakpoint.

_Video demonstration — see the online docs._

## Accessibility

While sighted users rely on visual cues such as font size changes to determine what the heading is, assistive technology users rely on programatic cues that can be read out. When text on a page is visually implied to be a heading, ensure that it is coded as a heading. Additionally, visually implied heading level and coded heading level should be consistent. See [WCAG success criteria: 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html).

Headings allow assistive technology users to quickly navigate around a page. Navigation as text that is not meant to be a heading can be a confusing experience. [Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/).

**✅ Do**

![](https://github.com/primer/brand/assets/912236/05b615e0-9f07-4718-8ce5-80109119b92a)

_Use headings with a lower rank to start new subsections that are part of the higher ranked section._

**❌ Don't**

![](https://github.com/primer/brand/assets/912236/876097cc-27a9-41c4-adab-24db8a3c6432)

_Don't skip heading ranks. Make sure that a h2 is not followed directly by an h4, for example._

## Related components

- [Text](../Text/index.md): to render body content
