Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom Headings for River and FAQ component #122

Open
stefankp opened this issue Nov 9, 2022 · 2 comments
Open

Allow custom Headings for River and FAQ component #122

stefankp opened this issue Nov 9, 2022 · 2 comments
Assignees
Labels
brand enhancement New feature or request

Comments

@stefankp
Copy link

stefankp commented Nov 9, 2022

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

@stefankp stefankp added the enhancement New feature or request label Nov 9, 2022
@rezrah
Copy link
Collaborator

rezrah commented Nov 14, 2022

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

@rezrah rezrah added the brand label Nov 14, 2022
@stefankp
Copy link
Author

stefankp commented Nov 14, 2022

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

  1. Heading and Text basic building blocks to do anything.
  2. River and SectionIntro components consisting of the above, but free to use independently.
  3. 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).

@rezrah rezrah self-assigned this Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brand enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants