4๏ธโƒฃARIA

This page provides an introduction to understanding ARIA and step-by-step guide for implementing and fixing ARIA issues with Flowy.

ARIA(Accessible Rich Internet Applications) was introduced as an extension to HTML5 to address the need for improved web accessibility for people with disabilities and ensure a more inclusive online experience for all users.

Introduction to ARIA

ARIA provides meaning for custom components and web applications that can be easily understood by assistive technologies (ATs) and presented to users in a way that makes sense to them. To better understand what ARIA is, we will use a building as an example. Picture yourself inside of a large building. There are no signs or directions to guide you. You become completely confused about where to go. But hey, along with a guide(ARIA) who shows you how to navigate and understand the different areas of the building easily.

ARIA Main Components: Roles, States and Properties

To create custom components/elements using ARIA, you need to define the roles, states and properties. Of course, you don't have to use all three elements of ARIA in a single line of code. It's optional, and you can use them separately if needed. ARIA consists of three important attributes: roles, states and properties.

  1. Roles: describes what a component does and how assistive technologies recognize and understand how it functions. For example, a component may be presented as a dialog, a button, a heading, a slider, or an accordion.

  2. States: States describe the current condition of an element. They always change when a user is interacting with a component. For example, a toggle button changes to true when in an open state and false when in a closed state.

  3. Properties: They show what an element is like or how it relates to other elements in your web page. Think of properties as labels for rooms in a building. Just like labels help you understand which rooms are bedrooms, bathrooms, or kitchens, properties help you learn about the features and how elements are connected to each other on your web page.

ARIA Naming Conventions

These are techniques for providing components with names/labels so that Assistive Technologies can communicate the purpose of the element and distinguish between elements.

  • aria-label: Use this when you want to provide a label to an element whose text is not visually present.

  • aria-labelledby: Use this when you want to connect an element to other parts of the web page to provide a clear and accessible name.

  • ariadescribedby: Use this when you want to reference longer content that provides a description.

How to Implement ARIA on Div and Span Elements with Flowy

This section provides a general overview of how to use Flowy with generic HTML elements like 'divs' and 'spans'. By following these guidelines, you can create content that is more accessible, including better screen reader compatibility and keyboard navigation.

Div

A <div> element in HTML is a generic container that groups and organizes content on a web page. It doesn't have an effect on the content or layout. The div element is quite flexible for adding accessibility features in cases where semantic HTML has not been used.

Using ARIA on a div will depend on the context of your web page.

Span

A <span> element is a simple HTML container. It doesn't have any special meaning by itself. It is mainly used to group elements together so that you can style them in a specific way. The span element is quite flexible for adding accessibility features in cases where semantic HTML has not been used.

Using ARIA on a span element will depend on the context of your web page.

How to Implement ARIA Landmarks with Flowy

This section provides a brief introduction to ARIA Landmarks and a step-by-step guide for implementing and fixing ARIA issues with Flowy.

Using ARIA on landmarks assists in improving the user experience and the accessibility of web pages for people including people using assistive technologies. Think of landmarks as a shortcut or quick access to various sections of a web page.

It is important to note landmarks should be used sparingly. Using too many landmark roles can make it confusing for screen readers to understand the layout of the page, creating unnecessary distractions.

Introduction

Adding an ARIA to make an element a form landmark is pretty simple. An ARIA form landmark does the same functions an HTML form landmark. You need to add the role attribute and set its value to 'formโ€™ as shown in the code sample below:

<div role="form" id="contactInfo" aria-label="Contact information">
...form content...
</div>

Things to Keep in mind when using ARIArole=โ€formโ€

  1. Do not add role=โ€™form on individual elements such as inputs, text areas, or selects. Instead, you should add it to the HTML element or container that contains all the form elements.

  2. Provide all form landmarks with labels. This will allow assistive technology users to understand the purpose of each form on your web page. Labeling techniques to use:

  3. Use aria-label when there is no visible heading (h2-h6) in the form content area.

  4. Use aria-labelledby to as to associate the visible heading title(s) with the form landmarks on your page using the id/class of the heading.

How to Fix and Implement Form Landmark using Flowy.

Step 1: Determine the section or element in your HTML code that represents the form content area of your web page and is relevant to assistive technologies and user experience.

Step 2: Click on 'Select Element'.

Step 4: Inside the 'Attribute' placeholder, click the 'plus' icon.

Step 5: Navigate to the 'Landmark' tab and select 'Form'

Step 6: Click on the 'Save' button

Step 7: Click on 'Add to Editor'. From the 'Test on Screen' drop-down, select 'Quick Fix'. Click on 'Quick Fix', and that's it.

Additional Resource: Using aria-required for required form fields

Last updated