The aria-current="page" attribute: the menu link NVDA announces as the current page


A menu styled with an .active class can highlight a link that NVDA never reports as the current page. The active-link example in the Next.js docs produces exactly that menu. The aria-current="page" attribute tells a screen reader which link leads to the page on display, and that link keeps its href. When the CSS reads the same attribute, the highlight lands on the link announced as the current page.
The current page link, from markup to style
#How do you use aria-current in a nav menu, and with which value?
The aria-current="page" attribute goes on the a element of the link to the page on display, and on that one link only. This ARIA attribute is for people who listen to the menu with a screen reader such as NVDA, free on Windows. They hear the links one after another and never see the highlight. NVDA only knows which page is current from this attribute, which Chrome passes on to it.
The attribute was made for that highlight: WAI-ARIA 1.2 intends it for the item in a set that the styling shows as current. The W3C even devoted a WCAG 2.2 technique to it, with a menu as its first example. Four rules are enough to check a menu's markup:
- the attribute goes on the
aof the link to the page on display; on theliit's still valid, although the link that Tab reaches then doesn't carry it; - only one link in the menu carries it;
- the other links get no attribute, since
aria-current="false"adds nothing to what NVDA says; - the link to the current page keeps its
href.
Our demo is the website of a driving school, Blinkstead, with a five-link menu. On its Pricing page, the first version highlights “Pricing” with an .active class on its li. The fixed version puts aria-current="page" on the a.

Avoid
<nav class="menu" aria-label="Main menu">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/courses">Courses</a></li>
<li class="active"><a href="/pricing">Pricing</a></li>
<li><a href="/online-theory">Online Theory</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>Correct
<nav class="menu" aria-label="Main menu">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/courses">Courses</a></li>
<li><a href="/pricing" aria-current="page">Pricing</a></li>
<li><a href="/online-theory">Online Theory</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>#Should the value be page or true?
For a site menu, write page. WAI-ARIA 1.2 defines page as the current page within a set of pages, and true as the current item within any set. You can hear the difference: NVDA is programmed to say “current page” for page, and only “current” for true. On the true version of the demo, “Pricing” loses the word “page”. The other values belong to other sets: step for the steps of a process, location for the current spot in an environment, such as a flow chart.
| Value | Words added to the link |
|---|---|
page | “current page” |
true | “current” |
step | “current step” |
location | “current location” |
false or missing | nothing |
#Should you remove the link to the current page?
No: the link keeps its href and carries the attribute. Without an href, the a element is no longer a link: Chrome sees only a generic element, and the Tab key skips it.
The HTML specification does show a navigation bar where the link to the page itself has no href. We reproduced that markup on the demo. In Chrome, four presses of Tab go through the menu, and the third jumps from “Courses” to “Online Theory”. Keyboard navigation never stops on “Pricing”. The W3C keeps the link: its ARIA26 technique and its navigation menu example put the attribute on a link that keeps its href.
#What does NVDA say on the current page link?
When the link to the current page gets focus, NVDA is programmed to say its name, the word “link”, then “current page”. Without the attribute, it adds nothing. On a link you've already visited, “visited” comes before “link”. We reconstructed these announcements from NVDA's source code, where its English labels live.
It takes a minute: with NVDA running and the page open in Chrome, move through the menu with Tab. Only one link should end with “current page”, the highlighted one. The K key also jumps from link to link in browse mode, the mode NVDA uses to read a page. To install NVDA, follow our guide. On a Mac, NVDA runs in a virtual machine.
On the demo version where an .active class highlights “Pricing”, the third press of Tab lands on that link. NVDA is programmed to say “Pricing, link”, just as it does for “Courses”. On the fixed version, it's programmed to say “Pricing, link, current page”.
Focus lands on the first link in the menu.
“Courses” is announced the same way as “Home”.
The only link that carries aria-current="page".
“Current page” doesn't come back.
When “current page” lands on the wrong link, look for the cause in the code that sets the attribute. Start with the router, which picks the page from the address.
#How do you keep the .active class and aria-current in sync?
Once the CSS reads aria-current="page", the highlighted link and the link announced as the current page can no longer differ. Before you rewrite the styles, check what your router or CMS already sets.
#Does your router or CMS already set aria-current="page"?
React Router, Vue Router and WordPress set the attribute on the current page link on their own, and Angular does it when asked. With Next.js or Bootstrap, you write it by hand on the link that carries the class, as Bootstrap's documentation tells you to.
| Tool | Sets aria-current="page" |
|---|---|
React Router, NavLink | yes |
Vue Router, RouterLink | yes |
Angular, routerLinkActive | with ariaCurrentWhenActive |
Next.js, Link | no |
| Bootstrap | no |
| WordPress, menus | yes |
The official Next.js example for an active link only adds a class. Follow it to the letter and you get the class version of our demo. For the page title and focus on every route change, see our React Router guide.
#What does the router do on a subpage that isn't in the menu?
A router's “active” class can also mark the parent section of the page on display, and the attribute doesn't always follow. We generated the demo menu with React Router, then with Vue Router, on the “Car License” subpage, which isn't in the menu.
Without the end prop, React Router's NavLink gives “Courses” the active class and aria-current="page". NVDA is then programmed to announce a link that leads elsewhere as the current page. The end prop removes both the class and the attribute. Angular's code also sets the attribute on the parent section when ariaCurrentWhenActive is defined, unless the exact: true option is set.
With nested routes, Vue Router keeps the attribute for the link to the page on display and gives “Courses” only its router-link-active class. In a classic theme, WordPress does the same: when “Car License” is a child page of “Courses”, the section gets the current-page-ancestor class, without the attribute. A theme that styles these classes then highlights a link that NVDA is programmed to announce as an ordinary one. That's the class version's flaw again, produced by the tool.
Marker 1. The Courses link in the menu, bold and underlined in red by the router-link-active class. Marker 2. The title of the page on display, Car License.That bar under “Courses” says “this page belongs to the section”, which is different information from the current page. In its menu example with submenus, the W3C keeps aria-current="page" for the page's own link. The parent section gets a thicker border and a title attribute, “Contains current page link”.
#Which CSS selector targets the current page link?
Replace .active with nav a[aria-current="page"]: this selector only matches the exact value page.
nav a[aria-current="page"] {
font-weight: 700;
box-shadow: inset 0 -6px 0 #c8102e; /* the red bar under the link */
}Written without a value, [aria-current] also matches a link marked aria-current="false". NVDA adds nothing to that link, and you're back to a highlight with no announcement.
The style also has to show without relying on color. The WCAG criterion Use of Color accepts color coding when another visual cue backs it up, here the bold weight and the bar. The attribute serves the screen reader, and the cue serves people who don't see colors well.
On the demo's Pricing page, one line of CSS changed: .active is gone, and the red bar hasn't moved. That bar can now only highlight a link that carries aria-current="page", the one NVDA is programmed to announce as the “current page”. The test in the W3C's ARIA26 technique comes down to one question: does the highlighted item carry aria-current, with a suitable value? On this menu, the answer can no longer be no.


