Allow custom Headings for River and FAQ component
River.Content does not accept a Heading with as="h2". River automatically applies as="h3" by default.
Using River and FAQ automatically uses h3 headings. Semantically, that doesn't always make sense, e.g. on https://accelerator.github.com the heading structure now goes from h1 to h3. Would be great to be able to customize the heading to h2 etc. when needed.
Actually, I would expect any component that uses Heading to be able to accept any parameters that Heading accepts.
cc @aguevara23
Yes, for some context the reason we default to h3 is to help enforce content order, whereby River should only ever appear beneath a SectionIntro, which uses a h2. Appreciate in hindsight how limiting this can be, so I would propose that we resolve this by maintaining the default, but forwarding an override.
cc. @danielguillan @ashygee
Thanks for the context. The way I see it we should enforce content order through the templates we build, not the components themselves, otherwise we create dependencies that don't always make sense. Example, SectionIntro doesn't exist yet and might not be required in each context.
To think about it differently, we can offer different "levels" of components with increased control, e.g
-
HeadingandTextbasic building blocks to do anything. -
RiverandSectionIntrocomponents consisting of the above, but free to use independently. -
RiverSection, a "section component" (words are hard 😄) consisting of the above and enforcing a certain order.
Think Brick (Primitives) -> House (Components) -> Neighborhood (Sections) -> City (Page template).
Closing as heading levels can be customized using the as prop (docs)