hzdg / hz-core

HZ's internal library of React Components 🚧
https://hz-core.netlify.com
0 stars 0 forks source link

Extract Sectioning components from 2U #43

Closed lettertwo closed 4 years ago

lettertwo commented 4 years ago

Is your feature request related to a problem? Please describe.

Document outline is a feature of the HTML5 spec that has not been implemented by any major browser or a11y vendor. As such, content hierarchy is still primarily determined via heading rank.

In traditional web development, document outlines are managed by incrementing and decrementing heading levels to match the hierarchy of the content on the page. However, React apps are not built as documents, but rather via composition of components.

The component abstraction works best when it doesn't know about things outside of its API boundaries, like how it fits into a larger content hierarchy.

The 2U sectioning Readme has more explanation and examples on how components can achieve document outline and content hierarchy in a decoupled and composable manner.

Describe the solution you'd like

Extract and package 2U's sectioning components.

Describe alternatives you've considered

When authoring an HTML document, it is often times possible just manually count and increment/decrement heading levels. Additionally, the overall impact of document outline on SEO and a11y is debatable.

Additional context

lettertwo commented 4 years ago

Closed by fc06f498fe10c2d733f96641a678f7a8330f699b

https://hz-core.netlify.app/sectioning