h1-h6

The h1 to h6 HTML elements represent six levels of headings.

XML Elements

h1, h2, h3, h4, h5, h6

Java Classes

H1, H2, H3, H4, H5, H6

Basics

Use heading elements in level order to express the logical hierarchy of a view’s content:

<h1 text="HTML Tags Sample"/>
<h2 text="Formatting Tags:"/>
<h2 text="Lists:"/>
<h3 text="Ordered List:"/>
<h3 text="Unordered List:"/>
<h2 text="Hyperlinks:"/>

Theme Variants

Use the themeNames attribute to style a heading as a badge. Combine badge with color, emphasis, shape, or size variants.

Variant Description Supported By

badge

Applies badge styling.

Aura, Lumo

success, warning, error, contrast

Applies a semantic color.

Aura, Lumo

primary

Adds stronger visual emphasis.

Aura, Lumo

pill

Rounds the badge corners.

Aura, Lumo

small

Makes the badge smaller.

Aura, Lumo

normal

Uses the regular badge size.

Aura, Lumo

Attributes

Common attributes serve the same purpose for all components. The following attributes are specific to headings:

Name Description Default

themeNames

Applies one or more variants listed in Theme Variants.

Handlers

Common handlers are configured in the same way for all components. The following handlers are specific to headings:

Name Description

ClickEvent

Fires when the heading is clicked. Use the click, singleClick, or doubleClick subject to select the click pattern.