Step by Step

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

6 min read
Mikhail ShaymardanovWeb Quality and Accessibility Expert

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 a of the link to the page on display; on the li it'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.

Screenshot: header of Blinkstead Driving School on cream paper, with the menu Home, Courses, Pricing, Online Theory and Contact; Pricing is in bold, underlined with a thick red bar.Marker 1. The Pricing link, bold and underlined in red in the menu.
The same red bar under “Pricing”marker 1 in both versions; when the link carries aria-current with the value page, NVDA is programmed to add “current page”.

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.

What NVDA is programmed to say in English for each value of aria-current
ValueWords added to the link
page“current page”
true“current”
step“current step”
location“current location”
false or missingnothing

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.


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”.

Click the demo, then press the key shown, or move on with “Next step”. Escape leaves the demo.
4 steps

On the third Tab, NVDA is programmed to add “current page” to the “Pricing” link alone; the other menu links are announced without it.

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.

What each tool sets on the link to the current page
ToolSets aria-current="page"
React Router, NavLinkyes
Vue Router, RouterLinkyes
Angular, routerLinkActivewith ariaCurrentWhenActive
Next.js, Linkno
Bootstrapno
WordPress, menusyes

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.

Screenshot: Car License page of Blinkstead Driving School. In the menu, Courses is in bold, underlined with a red bar; below it, the title Car License in white on blue and red bands, next to a black-and-white photo of two hands on a steering wheel.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.
On the “Car License” pagemarker 2, the router-link-active class highlights “Courses”marker 1, which doesn't carry aria-current: NVDA is programmed to announce it as an ordinary link.

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”.

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.


Share this article

Frequently asked questions

No. No success criterion requires it as such. WCAG describes it in a technique published in March 2026. The ARIA26 technique is sufficient for criterion 1.3.1 Info and Relationships when the highlight carries information. The W3C adds that techniques are examples and that none of them is required.

In Europe, the EN 301 549 standard requires every web page to meet that criterion, and Use of Color as well. It was drafted as one voluntary way to comply with the European Accessibility Act. The attribute covers what the screen reader receives, while a bold weight or a bar under the link keeps the highlight from relying on color alone.

The aria-selected attribute marks the chosen item inside a widget, such as the tab whose panel is showing in a tab list. The aria-current attribute marks the current item in a set, and WAI-ARIA 1.2 asks authors not to use it in place of aria-selected when both would mean the same thing.

In a navigation tree, the two can sit side by side: aria-current="page" points to the page on display, and aria-selected="true" to the page that will display if the user activates the item.

With a bracket variant: aria-[current=page]:font-bold. Written without brackets, aria-current:font-bold produces the selector [aria-current="true"], because Tailwind adds ="true" to any name written after aria-, as it does for aria-expanded. The link marked page then gets no style.

For an attribute that takes a value, Tailwind's documentation points to square brackets. Applied to aria-current, that rule gives the class at the start of this answer.