Heading

Accessibility

Heading

NameTypeDescription
as"h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6" \| "div"Defines the HTML element to be rendered.
role"heading"Can only be used if as="div". If defined, sets the role of the element to be “heading”.
levelnumberCan only be used if as="div" and ”role="heading”. Defines the aria-level of the rendered div with the heading role.
<Heading>Hello World!</Heading>
<div>Hello World!</div>
<Heading as="div" role="heading" level={1}>
Hello World!
</Heading>
<div role="heading" aria-level="1">Hello World!</div>
<Heading as="h1">Hello World!</Heading>
<h1>Hello World!</h1>

Compatibility with SkipNavigation