Skip to content

ActiveLink: add support for aria-current attribute #902

@msssk

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions