A styled, semantic heading element. The Heading component builds on top of Text and supports all Text props.
The Heading is a typography component that uses the native HTML semantic headings <h1>-<h6>. Headings are important for establishing the overall content outline of the page. Use them to break page content up into named sections of different subtopics.
The Text component serves as a base typography component that the Heading and other components are extended from. When a heading is needed on the page, prefer to use the Heading component over Text.
A common mistake with headings is choosing them based on stylistic properties, such as using an <h1> when larger text is needed. Heading levels are styled differently to ensure page hierarchy is clear at a glance in most scenarios. However, styles such as font size and weight are not always directly correlated with heading level.
Be sure to never reach for a Heading based on appearance. If Heading styles must be changed, use the available component props and maintain proper heading level structure.
Adhere to logical heading order within pages. Never skip heading levels as this creates a confusing document outline for assistive technology users. For more information from an accessibility standpoint, see Heading level hierarchy under the Accessibility tab.
Each page should only have one level 1 (<h1>) heading. It serves as the primary title and top-level landmark for the entire page. The page's main sections use level 2, subsections under 2 use level 3, and so on.
Heading inherits text color options from the Text component. Headings use the base text color by default. If no color is explicitly set, the Heading will automatically adapt to the color most appropriate for the background. When manually changing Heading colors, be sure they adhere to semantic meaning and use.
The base text color is default for Headings.
Text color automatically adjusts for contrast depending on the background color.
Heading inherits font family options from the Text component. Sans-serif is the default. Monospace is used for Headings in code-related contexts.
Sans-serif is the default for Headings.
Monospace is best used in code-based contexts.
Heading inherits font style options from the Text component. The Heading's font style is used to apply italic styling for visual emphasis without changing the Heading's semantic level.
Normal is the default style.
Italic is used sparingly for visual emphasis.
Headings support six levels that map to the HTML tags <h1> through <h6>. Levels 1 through 4 have their own typography styles while levels 5 and 6 share the same styles.
Levels are styled differently to make them visually distinct to the user.
Heading inherits font size options from the Text component. If a font size different from the default styles is needed, use this option to manually adjust the size and keep proper heading levels intact.
Heading sizes can be set independently from heading level.
Heading typography can be changed to a predefined set of styles that affect the font size, font weight, line height, and letter spacing. For the full list of available values and their styles, see the Text section of the tokens page.
Predefined typography styles can be applied to any heading level.
Heading inherits font weight options from the Text component. Font weight helps create a more prominent visual contrast between the Heading and surrounding text. If a font weight different from the default styles is needed, use this option to manually adjust the weight and keep proper heading levels intact.
Light font weight provides little visual emphasis.
The standard font weight provides no strong visual emphasis.
Semibold provides a moderate visual emphasis.
Bold provides a strong visual emphasis for more prominent headings.
Headings will wrap automatically when the container resizes. The wrapping algorithm used specifically avoids widows, single words on the last line of text.
Heading text should give the user enough context to understand the page and following supporting sections to come.
Six or fewer words is the ideal length. Longer Headings run the risk of obscuring key information that can be digested by a user at a glance. If a Heading requires more supplemental information, consider using a Paragraph below it.
Monitor the overall health and performance of your workspace.
Sentence case is preferred for Headings to maintain consistent writing across the application.
Omit punctuation from the Heading except in cases such as a confirmation modal that confirms an action.