Description
The Heading component is a helper to create automated semantic headings within a boundary of the web heading rules.
Basically, only assistive technologies do need semantic headings. But they need them correct.
How does it work? The heading leveling is handled synchronously. But you can easily isolate one level, or a part by using a context provider: <Heading.Level ...
. This allows you to later, asynchronous, add new headings inside. You can nest several contexts inside each.
The first code example is without using context provider. To handle levels in batches or asynchronous, use a Heading.Level
context provider.
Code Editor
<Heading.Level reset={1}> <Heading>h1</Heading> <Heading>h2</Heading> <Heading increase>h3</Heading> <Heading>still h3</Heading> <Heading increase>h4</Heading> <Heading increase>h5</Heading> <Heading decrease>h4</Heading> <Heading level={2}>back to h2</Heading> <Heading increase>h3</Heading> </Heading.Level>