Skip to content

[Navigation] Add ariaLabelledBy prop #4289

@mathildebuenerd

Description

@mathildebuenerd

Feature request summary

Add ariaLabelledBy prop that can be passed to Navigation component and added to the nav tag. They should contain the id of the navigation label.

Rationale

Currently it's not possible to pass a label to the Navigation component that can be used to differentiate this nav from other nav when navigating with landmarks.

We should be able to generate the following output (described here: https://www.w3.org/WAI/tutorials/menus/structure/#label-menus):

<nav aria-labelledby="mainmenulabel">
    <h2 id="mainmenulabel" class="visuallyhidden">Main Menu</h2>
</nav>

From this implementation:

<Navigation ariaLabelledBy="mainmenulabel">
    <VisuallyHidden>
        <h2 id="mainmenulabel">Main</h2>
    </VisuallyHidden>
</Navigation>

So that when navigating using landmarks there is an option "Main navigation".


🌟 Feature requests that are not yet planned will be closed. We then use the issue’s 👍 upvotes to track and set priorities. See the contribution guidelines for more information.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions