Skip to content

ActiveLink: add support for aria-current attribute #902

Description

@msssk

Enhancement

ActiveLink would benefit from adding support for the aria-current attribute. This could be achieved by adding an ariaCurrent property and setting it when the link is active.

export interface ActiveLinkProperties extends LinkProperties {
	activeClasses: SupportedClassName[];
	ariaCurrent?: 'page' | 'step' | 'location' | 'date' | 'time' | true;
	isExact?: boolean;
}

Code

<ActiveLink
    to="myRoute"
    classes="link"
    activeClasses="active"
    ariaCurrent="page"
>
    Link to my route
</ActiveLink>

Expected behavior:

<a href="myroute" class="link active" aria-current="page">Link to my route</a>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions