aria-current - examples and best practices (2024)

The aria-current attribute should be used to identify the current item in a set of items. Below we show some applications of this attribute to make websites more accessible to all users.

Definition

aria-current is an attribute defined in the WAI-ARIA(opens in a new tab)specification. This specification extends native HTML, allowing youto change the way an HTML element is "translated" into the accessibility tree.

The aria-current can be used to indicate that an element represents the currentitem within container or set of related elements. It can take multiple values, specifically:page, step, location, date, time, false, true.

When and how to use

aria-current="page"

Whenever you need to indicate the current page within a set of pagination links (main navigation),providing a screen reader alternative to styling the current page.

aria-current - examples and best practices (1)

Spotify Polaris(opens in a new tab) indicates the current page in the main navigation. While visible to sighted users, it also uses aria-current="page" to convey the information to screen reader users.

aria-current="location"

Whenever a website hierarchy is deeply nested, it's often a good practice todisplay the hierarchy of a given page using the Breadcrumbs Pattern.By using aria-current="location" we can mark the current page in the hierarchy to screen reader users.

aria-current - examples and best practices (2)

Service-Public.fr(opens in a new tab) website uses the Breadcrumbs Pattern to display the hierarchy of the current page.

aria-current="date"

When we display a list of dates, one being today's date, we should use the `aria-current="date"to mark the current date to screen reader users.

aria-current="step"

If we need to indicate the current step within a step indicator of a multi-step process (e.g.: wizardform, multi-step checkout, etc), aria-current="step" should be used to indicate thecurrent step to screen reader users.

aria-current - examples and best practices (4)

Swiss.com(opens in a new tab)'s process of buying a ticket is a multi-step process. Visually, the current step is indicated to sighted users. aria-current="step" should be used as an alternative to screen reader users.

Examples

Example 1: Breadcrumbs

<nav aria-label="breadcrumbs">

<ol>

<li>

<a href="/">

Home

</a>

</li>

<li>

<a href="/parent">

Parent

</a>

</li>

<li>

<a

href="/parent/current"

aria-current="location"

>

Current

</a>

</li>

</ol>

</nav>

aria-current vs. aria-selected

Tabs Widget

In widgets where aria-selected has the same meaningas aria-current, we should use aria-selected instead.

For example, when using Tabs, we should mark thecurrently selected tab with aria-selected="true. This has the same meaning asaria-current="page", but aria-selected="true" is preferred.

<div role="tablist" aria-label="Entertainment">

<button id="tab-1-button" role="tab"

aria-controls="tab-1" aria-selected="true">

Tab 1

</button>

<button id="tab-2-button" role="tab"

aria-controls="tab-2"

>

Tab 2

</button>

</div>

<div id="tab-1" role="tabpanel"

tabindex="0" aria-labelledby="tab-1-button"

>

...

</div>

<div id="tab-2" role="tabpanel"

tabindex="0" aria-labelledby="tab-2-button"

hidden

>

...

</div>

Date Picker Widget

Another place where it can be confusing to use either aria-current or aria-selected is on a date picker.The former should be used to signal today's date and the former should be used to signal theuser's selection.

aria-current - examples and best practices (5)

aria-current - examples and best practices (2024)
Top Articles
Western Union vs bank transfer – which is cheaper? | finder.com
What It's Like to Work as a Financial Planner
P.o. Box 806514 Chicago Il 60680
FREE Houses! All You Have to Do Is Move Them. - CIRCA Old Houses
Nambe Flatware Discontinued
Ddot Imagines
Silver Spring, MD to Nanuet, NY Bus
Ark Rag Desert Drops
619-354-3954
MBTA officially announces Sept. 30 date for partial reopening of Winchester Center Commuter Rail Station
Tsymo Pet Feeder Manual Pdf
Isabella Schmeichel
Highest-Paying VMware Certifications of 2024: Invest in Your Future
Kfvs12 Weather Radar Near Poplar Bluff Mo
7 Movierulz
Rent A Center Entertainment Center
Lake Compounce Family 4 Pack
Ark Fjordur Managarmr
Family Security Credit Union Gardendale
Noaa Weather Portland Or
Milton Shealy Funeral Home Obituaries
Renfield Showtimes Near Paragon Theaters - Coral Square
Strange World Showtimes Near Harkins Theatres Christown 14
Craigs List Corpus Christi
Commercial Credit Cards for Business Expenses | J.P. Morgan
Ludvigsen Mortuary Fremont Nebraska
Walmart Tire Center York Pa
Goddess Iah K
Cocaine Bear Showtimes Near Amc Dine-In Fashion District 8
Chickasaw Garbage And Sewer
What Is GIAC Certification? A Guide
Ezpz Escape Answer Key
On a testé : une brosse visage nettoyante qui n'a aucun défaut
Skyward Login Wylie Isd
Dino Petrone Salary
What Happened to Brookelyn Farthing? Is She Dead or Alive?
Appsanywhere Mst
Minooka Channahon Patch
Violent Night Showtimes Near Century 14 Vallejo
Saguaro Cactus: A Comprehensive Guide to the Carnegiea gigantea - The Cactus Encyclopedia
Infinityagents Login
2024 Busted VA Counties - Latest Arrests and Mugshots in Virginia
Best Cheap Rwd Cars
Kitco 24
Egusd Lunch Menu
Janitronics Team Hub
Contact us
Hmh Zip Code Locator
Craiglsist Cars
Trejo's Blanchard Menu
How to Authenticate Designer Clothes
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 5419

Rating: 4.4 / 5 (75 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.