Skip to content

[a11y] - Document best practice for use of aria-current with RouterLink / RouterLinkActive #35051

@ibenjelloun

Description

@ibenjelloun

🚀 feature request

Relevant Package

This feature request is for @angular/router

Description

RouterLinkActive adds a class to the element, it should add the aria-current attribute which must be set to 'Page' when isActive is true in the RouterLinkActive.

Describe alternatives you've considered

<a #fruitsLink="routerLinkActive" routerLinkActive="active" #fruitsRouterLink="routerLinkActive" [attr.aria-current]="fruitsRouterLink.isActive ? 'Page': undefined"  title="fruits" routerLink="/fruits" >Fruits 🍓</a>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Accessibilityissues related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: routerfreq3: highopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions