/handbook/react-best-practices/accessibility/

Good Work. Since 2009

Our Work

What We Do

Digital Platform MigrationsKey SolutionsManaged ServicesStaffing SolutionsIndustriesProducts



Drupal to WordPress



Kentico to WordPress



Sitecore to WordPress



AEM to WordPress



Umbraco to WordPress

Any CMS to WordPress

Arc XP to WordPress

Hubspot to WordPress

Contentful to WordPress

Optimizely to WordPress

Craft CMS to WordPress



Sanity to WordPress



Strapi to WordPress



OnePress

OnePress is a way to use WordPress for multi-brand organizations, intranet network sites or large publishers.

headless

Headless WordPress Development

Composable architecture and omnichannel content delivery engineered without sacrificing marketing autonomy.



WordPress as a composable DXP

We make a case for WordPress as a composable DXP when the market has realized that monolithic systems are not going to cut it



Frappe/ERPNext

Build scalable ERP and custom web applications with ERPNext — from implementation and integrations to long-term support.



Discovery

Strategic consultancy & project roadmap



Growth Services

On demand development & consultation



Site Maintenance

Annual maintenance. Done for you



QE Services

Testing across SDLC for assured quality



Hosting Migration

Move to a performant hosting with zero downtime



WooCommerce

Enterprise commerce delivered without lock-in



AI

Unlock real use cases and integrations



All Services

A suite of services for any need



Staff Augmentation

Scale your team quickly with vetted WordPress engineers, ready to join in a week.
backed by flexible pricing, transparent practices, and full-time zone support.

Technology STACK

React

Node.js

Next.js

w3c accessibilities

PWA

Laravel

Nginx

GraphQL

Typescript



Digital publication & media

Deliver content-rich digital experiences with scalable WordPress and headless solutions.



Large product & SaaS

Accelerate your product or SaaS growth with tailored development and robust integrations.



Automotive

Build secure, high-performance WordPress solutions for the automotive industry’s unique needs.



Conglomerates

Handle complex, multi-business operations with unified digital strategy and infrastructure.



eCommerce

Scale your e-commerce with WooCommerce, integrations, and custom extensions for growth.



All Industries

Helping enterprises across industries with scalable WordPress solutions and tailored strategies.



GoDAM

Built-in transcoding, adaptive bitrate streaming, interactive video overlays, and asset management.



EasyEngine

Server management tool that makes using WordPress on Nginx easy.



Web Auditor

Performance Audit & Insights for your Website.

rtmedia

rtMedia

A complete media management plugin for WordPress.

Resources

Resources thumbnail

Resources

Extensive resources published from our enterprise web practice, covering migrations, multisite consolidations, DXP, and more.

Newsletters

Subscribe

client handbook thumbnail

Client Handbook

Blog thumbnail

Blogs

About Us



Good Work.
Good People.

About Us

The story behind becoming the go-to agency for global enterprises, & delivering scalable digital experiences with our 250+ professionals.

Partnerships

WordPress VIP Agency Partner

Pagely Partnerships

Frappe / ERP Partnership



Open Source Contributions



Careers

CLEAR

contact us

separator Resources separator React project best practices separator Accessibility

Topics

On this page

WCAG – Web Content Accessibility Guidelines

WCAG Principles (POUR)

WCAG Conformance Levels (A, AA, AAA)

WCAG 2.1 Level AA – What it means:

WCAG Checklist

WAI- ARIA: Web Accessibility Initiative – Accessible Rich Internet Applications

Why ARIA exists?

Why ARIA matters in React?

ARIA best practices in React

Structural Elements: Headings & Lists

A. Headings

B. Lists

Links

1) Always use real <a> elements

2) Provide clear, descriptive link text

2) Maintain a visible focus style

Buttons

Form elements

Modals & dialogs

Carousels (Slide Show)

Images

Always choose the right alternative text

Avoid images of text

Testing accessible images

In-Page tabbed component – tabs pattern

When to use automatic vs manual activation?

Roles, states and properties

Tables

Color contrast

Tools and packages

POUR principles ref 

Perceivable

Operable

Understandable

Robust

How to make accessible UI

Start with Radix/Shadcn components

Manage color and contrast

Provide accessible labels

Testing for accessibility

Last updated on Apr 2, 2026

Accessibility

Web accessibility (also referred to as a11y) is the design and creation of websites that can be used by everyone. Accessibility support is necessary to allow assistive technology to interpret web pages.

React fully supports building accessible websites, often by using standard HTML techniques.

WCAG – Web Content Accessibility Guidelines

It is an internationally recognized set of guidelines developed by the World Wide Web Consortium (W3C) to make web content more accessible to people with disabilities.

WCAG Principles (POUR)

The guidelines are built around four principles:

  1. Perceivable: Content must be presented in ways users can perceive (e.g., text alternatives for images, captions for video).
  2. Operable: Users must be able to interact with content (e.g., full keyboard navigation, visible focus states).
  3. Understandable: Content and UI must be easy to understand (e.g., clear labels, predictable navigation).
  4. Robust: Content should be compatible with assistive technologies (e.g., screen readers).

WCAG Conformance Levels (A, AA, AAA)

There are three levels:

LevelMeaningImportanceAMinimum requirementsBasic accessibility for many usersAAMid-level, industry standardAddresses the biggest barriers for people with disabilitiesAAAHighest levelOften used by governments or for specialized accessibility needs

WCAG 2.1 Level AA – What it means:

We should at least aim for WCAG 2.1 Level AA.
Level AA includes all Level A requirements plus additional rules for usability and inclusivity:

WCAG Checklist

The following WCAG checklists provide an overview:

WAI- ARIA: Web Accessibility Initiative – Accessible Rich Internet Applications

ARIA is a set of attributes defined by the W3C (World Wide Web Consortium) to make web applications and dynamic content more accessible to people who use assistive technologies like screen readers.

Why ARIA exists?

Since React apps often build custom UI components (modals, dropdowns, tabs, sliders) that don’t always map cleanly to native HTML semantics, ARIA ensures that these components are correctly understood by assistive tools.

Why ARIA matters in React?

Note that all aria-* HTML attributes are fully supported in JSX. Whereas most DOM properties and attributes in React are camelCased, these attributes should be hyphen-cased (also known as kebab-case, lisp-case, etc.) as they are in plain HTML.


			<input
  type="text"
  aria-label={labelText}
  aria-required="true"
  onChange={onchangeHandler}
  value={inputValue}
  name="name"
/>

		

ARIA best practices in React

Structural Elements: Headings & Lists

Structure is how assistive tech (and search engines) understand your page. Use semantic HTML first and keep the outline predictable. This section covers headings and lists in React, with code patterns, do/don’ts, and testing tips.

A. Headings

Goals

Core rules

Example    


			export default function ProductPage() {
  return (
    <main>
      <h1>Travel Mugs</h1>

      <section aria-labelledby="filters-heading">
        <h2 id="filters-heading">Filters</h2>
        {/* … */}
      </section>

      <section aria-labelledby="results-heading">
        <h2 id="results-heading">Results</h2>
        {/* … */}
      </section>
    </main>
  );
}

		

B. Lists

Goals

Choose right list type

Don’t

Sectioning & Landmarks (works with headings)


			<a href="#main" className="sr-only focus:not-sr-only">Skip to main content</a>
<main id="main">…</main>

		

Links

Links (<a>) are one of the most important structural elements on the web. For React apps, ensuring links are semantic, accessible, and usable with both keyboard and assistive technologies is essential.

1) Always use real <a> elements


			// ✅ Correct
<a href="/about">About Us</a>

// ❌ Wrong (not accessible as a link)
 navigate('/about')}>About Us</div>

		

2) Provide clear, descriptive link text


			// ✅ Good
<a href="/pricing">View pricing plans</a>

// ❌ Bad
<a href="/pricing">Click here</a>

// For repeated links
<a href={`/articles/${id}`}>
  Read more <span className="sr-only">about {title}</span>
</a>

		

2) Maintain a visible focus style


			a:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

		

Buttons


			<button aria-label="Close dialog">
  <CloseIcon aria-hidden="true" />
</button>

		

			<button
  aria-expanded={open}
  aria-controls="menu"
  onClick={() => setOpen(!open)}
>
  Menu
</button>

		

Form elements


			<label htmlFor="email">Email</label>
<input id="email" type="email" />

		

			<fieldset>
  <legend>Delivery Options</legend>
  <label><input type="radio" name="delivery" value="standard" /> Standard</label>
  <label><input type="radio" name="delivery" value="express" /> Express</label>
</fieldset>

		

			<label htmlFor="username">Username</label>
<input id="username" aria-describedby="username-help" />
<p id="username-help">Must be at least 6 characters.</p>

		

Modals & dialogs

Carousels (Slide Show)


			<div aria-live="polite" class="sr-only" role="status">
  Slide 4 of 9. Offer for Abacos, Bahamas now visible.
</div>

		

			<div role="group" aria-roledescription="slide" aria-label="Offer for British Virgin Islands" tabindex="-1">
  ...Slide content....
</div>

		

Images

Accessible images make your UI usable for people who rely on assistive tech (screen readers, braille displays), and they improve SEO and performance. This guide focuses on what to show and how to code it in React.

Always choose the right alternative text

Based on the correct choice of alt text, images can be divided into four categories:

A. Informative images (convey meaning)


			<img src="/team/alex.jpg" alt="Alex Nguyen, Customer Success Manager" />
		

B. Functional images (links/buttons/icons that perform actions)

For functional images, the accessible name must describe the action or destination, not the picture.


			<a href="/cart">
  <img src="/icons/cart.svg" alt="View cart" />
</a>

<button aria-label="Close dialog">
  <img src="/icons/close.svg" alt="" aria-hidden="true" />
</button>

		

C. Decorative images (purely visual / redundant)

Use an empty alt or role=”presentation” so screen readers skip it.


			<img src="/decor/gradient.png" alt="" />
or
<img src="/decor/gradient.png" role="presentation" />
		

Inline SVG icons used as decoration


			<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24">…</svg>
		

D. Complex images (charts, diagrams, infographics)

Provide a short alt + a longer description nearby. Use <figure> and <figcaption> or reference text with aria-describedby.


			<figure>
  <img src="/charts/sales-q4.png" alt="Q4 sales by region bar chart" aria-describedby="chart-desc" />
  <figcaption id="chart-desc">
    North America leads with $2.1M, followed by EMEA $1.6M, APAC $1.1M. YoY growth 12%.
  </figcaption>
</figure>

		

Avoid images of text

Testing accessible images

In-Page tabbed component – tabs pattern

There are two most common tab patterns:

Behaviour

When to use automatic vs manual activation?

Roles, states and properties

Tables

Color contrast

Tools and packages

POUR principles ref

Perceivable

Operable

Understandable

Robust

How to make accessible UI

Start with Radix/Shadcn components

WAI-ARIA compliance – Correct ARIA roles, states, and properties (aria-expanded, aria-controls, role="dialog", etc.) are managed for you.

Full keyboard navigation – All components are operable with a keyboard (e.g., arrow keys for menus, Tab for focus, Enter/Space for activation, Esc for dismissal).

Focus management – It intelligently handles focus, trapping it within modals and returning it to the trigger element when the modal is closed. This is a huge win for accessibility and is difficult to implement correctly from scratch.

Manage color and contrast

Provide accessible labels

Testing for accessibility

Do read our article on All about Web Accessibility, WCAG and making WordPress website more compliant.

Dependency management

PREVIOUS

React frameworks

NEXT


Credits

Sayed

Sayed Taqui

Author

Sayed Taqui

Author

Seasoned React, JavaScript, and WordPress Developer. Contributed significantly to WordPress Core. Currently serving as the Lead WordPress Engineer at rtCamp. Passionate about crafting innovative so…

VIEW PROFILE

Imran

Imran Sayed

Author

Imran Sayed

Author

Senior Software Engineer and Full-Stack Web Developer building high-performance, user-centric web applications that drive business growth. Expertise lies in e-commerce development, custom WordPress…

VIEW PROFILE

Ayush

Ayush Nirwal

Author

Ayush Nirwal

Author

VIEW PROFILE

Amoghavarsha

Amoghavarsha Kudaligi

Author

Amoghavarsha Kudaligi

Author

VIEW PROFILE

Mayank

Mayank Rana

Author

Mayank Rana

Author

VIEW PROFILE

Good Work. Good People.

Industry partnerships

WordPress VIP Gold Agency Partner

WordPress VIP Partner Innovator

Compliance certifications

location-icon United States  location-icon India

© rtCamp Inc. since 2009. All rights reserved.

Terms of Service · Privacy Policy · Trust Center

Company

Solutions

Subscribe to our newsletter and get a few email updates every month.

subscribe to newsletter

location-icon United States  location-icon India

© rtCamp Inc. since 2009. All rights reserved.

Terms of Service · Privacy Policy · Trust Center

Cookie Consent

We value your privacy

We use cookies to give you the best possible experience. By clicking “Accept,” you consent to our use of cookies to improve site functionality, analyze usage, and personalize content and communications. Your privacy matters to us, and we are committed to handling your data responsibly and transparently. Please check our Privacy Policy for more details.

Manage PreferencesDon’t AllowAllow All

Why do we use cookies?

×

By clicking "Accept" or "Decline All" at the bottom, you consent to the use of cookies and other tools as described in our Cookie Policy in accordance with your settings and accept our Terms of Service.

Toggle EssentialEssential

Essential cookies enable basic functions and are necessary for the proper function of the website.

Name

Description

Duration

Geolocation Config

This cookie is used to store the consent settings based on the visitor's location.

30 days

Cookie Preferences

This cookie is used to store the user's cookie consent preferences.

30 days

Toggle CloudFlareCloudFlare

CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.

Service URL: developers.cloudflare.com (opens in a new window)

Name

Description

Duration

cf_clearance

Whether a CAPTCHA or Javascript challenge has been solved.

session

Toggle CommentsComments

These cookies are needed for adding comments on this website.

Name

Description

Duration

comment_author

Used to track the user across multiple sessions.

Session

comment_author_email

Used to track the user across multiple sessions.

Session

comment_author_url

Used to track the user across multiple sessions.

Session

Toggle GodamGodam

GoDAM" is primarily a specialized WordPress plugin and media management service designed to enhance video hosting, marketing, and asset management directly within the WordPress dashboard.

Service URL: godam.io (opens in a new window)

Name

Description

Duration

user_image

Temporarily stores the path to the user's avatar or profile picture for quick rendering in the website header.

session

user_id

Stores the numerical ID of the logged-in user to maintain session continuity and basic site operations.

session

full_name

Stores the logged-in user's display name to personalize the site interface without needing database queries.

session

system_user

First-party cookie used to store basic application state identifying the current system user role.

session

sid

A generic session ID cookie used to maintain user state and functionality as the visitor navigates through the site.

session

Toggle Google reCAPTCHAGoogle reCAPTCHA

Google reCAPTCHA helps protect websites from spam and abuse by verifying user interactions through challenges.

Name

Description

Duration

_GRECAPTCHA

Google reCAPTCHA sets a necessary cookie (_GRECAPTCHA) when executed for the purpose of providing its risk analysis.

179 days

Toggle Google Tag ManagerGoogle Tag Manager

Google Tag Manager simplifies the management of marketing tags on your website without code changes.

Name

Description

Duration

cookiePreferences

Registers cookie preferences of a user

2 years

td

Registers statistical data on users' behaviour on the website. Used for internal analytics by the website operator.

session

Toggle StatisticsStatistics

Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.

Toggle Factors AIFactors AI

Factors.ai is a B2B account intelligence and marketing analytics platform that helps Go-To-Market (GTM) teams identify anonymous website visitors, track buyer journeys, and measure the ROI of marketing campaigns.

Service URL: www.factors.ai (opens in a new window)

Name

Description

Duration

_fuid

It is sent to capture session details and track user behavior across your website to provide behavioral data and intent signals.

1 Year

Toggle Google AnalyticsGoogle Analytics

Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.

Service URL: policies.google.com (opens in a new window)

Name

Description

Duration

FPGSID

Stores a session or user identifier to track how visitors interact with a website. This helps Google Analytics measure website performance, user engagement, and usage patterns.

Session

FPLC

Used by Google Analytics to link visitor interactions and sessions across multiple related domains.

20 hours

FPID

A server-side Google Analytics cookie used as an alternative user identifier when third-party cookies are restricted.

2 years

_ga

ID used to identify users

2 years

_ga_

ID used to identify users

2 years

Toggle Jetpack StatsJetpack Stats

Jetpack's built-in visitor analytics. It records page views, referring sites, search terms, and outbound link clicks, and also carries the shared visitor-tracking library used by Jetpack Instant Search and WooCommerce Analytics.

Service URL: automattic.com (opens in a new window)

Name

Description

Duration

tk_aip

Stores a list of anonymous visitor IDs so they can be merged into one identity once a visitor is recognized.

Up to 5 years

tk_tc

Used once per page load to work out which cookie domain the Tracks library should use, then removed as soon as it's read back.

Session (deleted immediately after use)

tk_qs

Queues analytics events for Jetpack's Tracks library so none are lost if the page closes before they can be sent.

30 minutes

tk_ai

Stores a randomly-generated anonymous visitor ID so Jetpack's Tracks analytics library can link tracking events to the same visitor.

Session in wp-admin; up to 5 years on the frontend

Toggle Microsoft ClarityMicrosoft Clarity

Clarity is a web analytics service that tracks and reports website traffic.

Service URL: clarity.microsoft.com (opens in a new window)

Name

Description

Duration

CLID

Identifies the first-time Clarity saw this user on any site using Clarity.

12 months

ANONCHK

Indicates whether MUID is transferred to ANID, a cookie used for advertising. Clarity doesn't use ANID and so this is always set to 0.

Session

_clck

Persists the Clarity User ID and preferences, unique to that site is attributed to the same user ID.

12 months

_clsk

Connects multiple page views by a user into a single Clarity session recording.

12 months

Toggle Parse.lyParse.ly

Parse.ly is a content analytics platform that helps publishers optimize audience engagement and content performance.

Name

Description

Duration

cookies.js_dtest

This cookie determines whether the browser accepts cookies.

session

_parsely_session

JSON document storing information identifying a browsing session according to Parsely’s proprietary definition

30 minutes

_parsely_visitor

JSON document uniquely identifying a browser and counting its sessions

13 months

Toggle SalespanelSalespanel

Salespanel is a B2B marketing and sales software that identifies, tracks, and qualifies website visitors and leads in real-time using first-party data. It helps businesses monitor customer journeys, score leads based on behavior, and syncs this data with CRMs (like Pipedrive or HubSpot) to improve conversion rates.

Service URL: salespanel.io (opens in a new window)

Name

Description

Duration

track_uid

Identify and tracking a lead

12 moths

Toggle MarketingMarketing

Marketing cookies are used to follow visitors to websites. The intention is to show ads that are relevant and engaging to the individual user.

Toggle Bing / MicrosoftBing / Microsoft

Bing, powered by Microsoft, is a search engine providing web, image, video, and map search capabilities.

Name

Description

Duration

MR

Used to collect information for analytics purposes.

6 months

ANONCHK

Used to store session ID for a users session to ensure that clicks from adverts on the Bing search engine are verified for reporting purposes and for personalisation

10 minutes

SM

Used by Microsoft in synchronizing the MUID across multiple Microsoft domains to track users for advertising.

session

MUID

Identifies unique web browsers visiting Microsoft sites. These cookies are used for advertising, site analytics, and other operational purposes.

1 year

Toggle DoubleClick/Google MarketingDoubleClick/Google Marketing

A comprehensive digital advertising platform for managing campaigns, optimizing performance, and analyzing audience data.

Name

Description

Duration

IDE

This cookie is used for targeting, analyzing and optimisation of ad campaigns in DoubleClick/Google Marketing Suite

2 years

ar_debug

Store and track conversions

Persistent

Toggle LinkedInLinkedIn

LinkedIn is a professional networking platform for job seekers, employers, and industry connections.

Name

Description

Duration

bscookie

Used by LinkedIn to track the use of embedded services.

1 year

AnalyticsSyncHistory

Used to store information about the time a sync with the lms_analytics cookie took place for users in the Designated Countries

30 days

bcookie

Used by LinkedIn to track the use of embedded services.

1 year

li_sugr

Used to make a probabilistic match of a user's identity outside the Designated Countries

90 days

lidc

Used by the social networking service, LinkedIn, for tracking the use of embedded services.

1 day

UserMatchHistory

Used by LinkedIn Ads to synchronize and match user IDs across different ad networks and data providers.

30 days

Toggle LinkedIn InsightLinkedIn Insight

LinkedIn Insight is a web analytics service that tracks and reports website traffic.

Service URL: www.linkedin.com (opens in a new window)

Name

Description

Duration

li_sugr

Used to make a probabilistic match of a user's identity.

90 days

lidc

Used for routing and session management.

24 hours

Toggle LiveIntentLiveIntent

LiveIntent provides a platform for email advertising and identity-driven marketing solutions.

Name

Description

Duration

_lc2_fpi_js

Companion cookie to _lc2_fpi used by JavaScript to facilitate cross-domain ad tracking and user identification.

1 year

_lc2_fpi

First-party tracking cookie usually associated with LiveRamp to identify users across devices for targeted advertising.

1 Year

_li_ss

Sets a unique ID for the visitor, that allows third party advertisers to target the visitor with relevant advertisement. This pairing service is provided by third party advertisement hubs, which facilitates real-time bidding for advertisers.

1 month

lidid

Collects data on visitors' behaviour and interaction - This is used to make advertisement on the website more relevant. The cookie also allows the website to detect any referrals from other websites.

2 years

Toggle Cookie PolicyCookie Policy

You can find more information in our Privacy Policy.

Allow AllDecline All

Accept