When to use aria labels
Author: a | 2025-04-24
ARIA gives us two ways to do this: aria-label and aria-labelledby: aria-label Use aria-label only when the visible text is insufficient or unclear (e.g, an icon-only button) or when
When to Use ARIA-Label and ARIA-Labeledby
The Web Content Accessibility Guidelines (WCAG) emphasize the importance of creating an inclusive web experience for all users. One crucial aspect of achieving this is the proper implementation of the Accessible Rich Internet Applications (ARIA) specification, which helps improve web accessibility for users with disabilities.Role of ARIA in enhancing Drupal accessibilityDrupal, a widely-used open-source content management system, is committed to accessibility and has many built-in features that follow WCAG guidelines. This article will explore how integrating ARIA in Drupal can further enhance the accessibility of Drupal websites.Understanding ARIA BasicsWhat is Accessible Rich Internet Applications (ARIA)?ARIA is a set of attributes that define ways to make web content and applications more accessible for people with disabilities. ARIA helps assistive technologies, like screen readers, understand and interact with complex web elements.ARIA roles, states, and propertiesARIA consists of three main components: roles, states, and properties. Roles define the structure and purpose of elements, while states and properties provide additional information about the element’s current status and behavior. For example, role="navigation" indicates that the element is a navigation component, and aria-expanded="true" specifies that a dropdown menu is currently expanded.Benefits of using ARIA in DrupalImplementing ARIA in Drupal websites enhances the user experience for people with disabilities, ensuring that all users can access and interact with web content effectively.ARIA Implementation in DrupalIntegrating ARIA with Drupal themes and modulesTo incorporate ARIA in Drupal, start by adding ARIA roles, states, and properties to your theme's HTML templates. For instance, you can add role="banner" to your site header or role="contentinfo" to the footer. Additionally, you can utilize Drupal modules that support ARIA attributes, such as the Accessibility module.Customizing ARIA attributes for content types and fieldsDrupal's field system allows you to attach ARIA attributes to specific content types and fields, ensuring that each content element has the appropriate accessibility information. In the field settings, you can add custom attributes, such as aria-labelledby or aria-describedby, to associate labels and descriptions with form fields.ARIA landmarks for improved site navigationARIA landmarks help users navigate a website by providing a clear structure. Use ARIA landmarks in Drupal to define major sections, such as headers, navigation, main content, and footers. To implement landmarks, add the appropriate ARIA role to the corresponding HTML elements, like or .Using ARIA live regions for dynamic content updatesARIA live regions allow assistive technologies to announce updates in real-time. Implement live regions in Drupal by adding the "aria-live" attribute to ARIA gives us two ways to do this: aria-label and aria-labelledby: aria-label Use aria-label only when the visible text is insufficient or unclear (e.g, an icon-only button) or when OverviewProvides keyboard access to landmark regions and headings (h1–h6) on a web page.OverviewSkipTo Landmarks & Headings extends the web browser by providing a menu for easy navigation to the ARIA landmark regions and HTML section headings of a web page.The keyboard shortcut for opening the menu is alt+2 (option+2 on Mac keyboards) and cursors keys can be used to navigate the menu.Activating a menu item scrolls the corresponding landmark region or heading element into view and moves keyboard focus to it on the page.DetailsVersion2.2.0UpdatedOctober 9, 2021Offered byNicholas HoytSize34.43KiBLanguagesDeveloper Email nhoyt.cws@gmail.comNon-traderThis developer has not identified itself as a trader. For consumers in the European Union, please note that consumer rights do not apply to contracts between you and this developer.PrivacyThe developer has disclosed that it will not collect or use your data.This developer declares that your data isNot being sold to third parties, outside of the approved use casesNot being used or transferred for purposes that are unrelated to the item's core functionalityNot being used or transferred to determine creditworthiness or for lending purposesRelatedLandmark Navigation via Keyboard or Pop-up4.6(9)Allows you to navigate a web page via WAI-ARIA landmarks, using the keyboard or a pop-up menu.Siteimprove Accessibility Checker3.3(23)Jumpstart your web accessibility efforts directly in Chrome.NerdeRegion0.0(0)Debug Aria Live Regionstaba11y - Tab order accessibility testing5.0(15)Visualise tab order with easeHeadingsMap4.6(73)To show, browse and audit (for accessibility and SEO) the headings structureWCAG Color contrast checker4.2(28)To check the color contrast between foreground and background of the textsARIA DevTools4.9(34)Easily spot missing ARIA labels, misused ARIA roles, and incompleteComments
The Web Content Accessibility Guidelines (WCAG) emphasize the importance of creating an inclusive web experience for all users. One crucial aspect of achieving this is the proper implementation of the Accessible Rich Internet Applications (ARIA) specification, which helps improve web accessibility for users with disabilities.Role of ARIA in enhancing Drupal accessibilityDrupal, a widely-used open-source content management system, is committed to accessibility and has many built-in features that follow WCAG guidelines. This article will explore how integrating ARIA in Drupal can further enhance the accessibility of Drupal websites.Understanding ARIA BasicsWhat is Accessible Rich Internet Applications (ARIA)?ARIA is a set of attributes that define ways to make web content and applications more accessible for people with disabilities. ARIA helps assistive technologies, like screen readers, understand and interact with complex web elements.ARIA roles, states, and propertiesARIA consists of three main components: roles, states, and properties. Roles define the structure and purpose of elements, while states and properties provide additional information about the element’s current status and behavior. For example, role="navigation" indicates that the element is a navigation component, and aria-expanded="true" specifies that a dropdown menu is currently expanded.Benefits of using ARIA in DrupalImplementing ARIA in Drupal websites enhances the user experience for people with disabilities, ensuring that all users can access and interact with web content effectively.ARIA Implementation in DrupalIntegrating ARIA with Drupal themes and modulesTo incorporate ARIA in Drupal, start by adding ARIA roles, states, and properties to your theme's HTML templates. For instance, you can add role="banner" to your site header or role="contentinfo" to the footer. Additionally, you can utilize Drupal modules that support ARIA attributes, such as the Accessibility module.Customizing ARIA attributes for content types and fieldsDrupal's field system allows you to attach ARIA attributes to specific content types and fields, ensuring that each content element has the appropriate accessibility information. In the field settings, you can add custom attributes, such as aria-labelledby or aria-describedby, to associate labels and descriptions with form fields.ARIA landmarks for improved site navigationARIA landmarks help users navigate a website by providing a clear structure. Use ARIA landmarks in Drupal to define major sections, such as headers, navigation, main content, and footers. To implement landmarks, add the appropriate ARIA role to the corresponding HTML elements, like or .Using ARIA live regions for dynamic content updatesARIA live regions allow assistive technologies to announce updates in real-time. Implement live regions in Drupal by adding the "aria-live" attribute to
2025-04-03OverviewProvides keyboard access to landmark regions and headings (h1–h6) on a web page.OverviewSkipTo Landmarks & Headings extends the web browser by providing a menu for easy navigation to the ARIA landmark regions and HTML section headings of a web page.The keyboard shortcut for opening the menu is alt+2 (option+2 on Mac keyboards) and cursors keys can be used to navigate the menu.Activating a menu item scrolls the corresponding landmark region or heading element into view and moves keyboard focus to it on the page.DetailsVersion2.2.0UpdatedOctober 9, 2021Offered byNicholas HoytSize34.43KiBLanguagesDeveloper Email nhoyt.cws@gmail.comNon-traderThis developer has not identified itself as a trader. For consumers in the European Union, please note that consumer rights do not apply to contracts between you and this developer.PrivacyThe developer has disclosed that it will not collect or use your data.This developer declares that your data isNot being sold to third parties, outside of the approved use casesNot being used or transferred for purposes that are unrelated to the item's core functionalityNot being used or transferred to determine creditworthiness or for lending purposesRelatedLandmark Navigation via Keyboard or Pop-up4.6(9)Allows you to navigate a web page via WAI-ARIA landmarks, using the keyboard or a pop-up menu.Siteimprove Accessibility Checker3.3(23)Jumpstart your web accessibility efforts directly in Chrome.NerdeRegion0.0(0)Debug Aria Live Regionstaba11y - Tab order accessibility testing5.0(15)Visualise tab order with easeHeadingsMap4.6(73)To show, browse and audit (for accessibility and SEO) the headings structureWCAG Color contrast checker4.2(28)To check the color contrast between foreground and background of the textsARIA DevTools4.9(34)Easily spot missing ARIA labels, misused ARIA roles, and incomplete
2025-04-24Operation if an attempt is made to drop on this object. Ignored if combined with any other token value. e.g. 'none copy' is equivalent to a 'copy' value.aria-grabbedIndicates an element's "grabbed" state in a drag-and-drop operation.Values: Relationship Attributesaria-activedescendantIdentifies the currently active descendant of a composite widget. Used to deal with multiple focusable children, ie. in a tree menu.Values: aria-controlsIdentifies the element (or elements) whose contents or presence are controlled by the current element. See related aria-owns. Announced for form controls.Values: aria-describedbyIdentifies the element (or elements) that describes the object. See related aria-labelledby.Values: aria-flowtoIdentifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.Values: aria-labelledbyIdentifies the element (or elements) that labels the current element. See related aria-label and aria-describedby.Values: aria-ownsIdentifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship. See related aria-controls.Values: aria-posinsetDefines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. See related aria-setsize.Values: aria-setsizeDefines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. See related aria-posinset.Values: LicenseMIT © Filipe Linhares
2025-04-05Cat.aria, wcag2a, wcag412, EN-301-549, EN-9.4.1.2 failure, needs review 5c01ea aria-required-attr Ensures elements with ARIA roles have all required ARIA attributes Critical cat.aria, wcag2a, wcag412, EN-301-549, EN-9.4.1.2 failure 4e8ab6 aria-required-children Ensures elements with an ARIA role that require child roles contain them Critical cat.aria, wcag2a, wcag131, EN-301-549, EN-9.1.3.1 failure, needs review bc4a75, ff89c9 aria-required-parent Ensures elements with an ARIA role that require parent roles are contained by them Critical cat.aria, wcag2a, wcag131, EN-301-549, EN-9.1.3.1 failure ff89c9 aria-roles Ensures all elements with a role attribute use a valid value Critical cat.aria, wcag2a, wcag412, EN-301-549, EN-9.4.1.2 failure 674b10 aria-toggle-field-name Ensures every ARIA toggle field has an accessible name Serious cat.aria, wcag2a, wcag412, TTv5, TT5.c, EN-301-549, EN-9.4.1.2, ACT failure, needs review e086e5 aria-tooltip-name Ensures every ARIA tooltip node has an accessible name Serious cat.aria, wcag2a, wcag412, EN-301-549, EN-9.4.1.2 failure, needs review aria-valid-attr-value Ensures all ARIA attributes have valid values Critical cat.aria, wcag2a, wcag412, EN-301-549, EN-9.4.1.2 failure, needs review 6a7281 aria-valid-attr Ensures attributes that begin with aria- are valid ARIA attributes Critical cat.aria, wcag2a, wcag412, EN-301-549, EN-9.4.1.2 failure 5f99a7 blink Ensures elements are not used Serious cat.time-and-media, wcag2a, wcag222, section508, section508.22.j, TTv5, TT2.b, EN-301-549, EN-9.2.2.2 failure button-name Ensures buttons have discernible text Critical cat.name-role-value, wcag2a, wcag412, section508, section508.22.a, TTv5, TT6.a, EN-301-549, EN-9.4.1.2, ACT failure, needs review 97a4e1, m6b1q3 bypass Ensures each page has at least one mechanism for a user to bypass navigation and jump straight to the content Serious cat.keyboard, wcag2a, wcag241, section508, section508.22.o, TTv5, TT9.a, EN-301-549, EN-9.2.4.1 needs review cf77f2, 047fe0, b40fd1, 3e12e1, ye5d6e color-contrast Ensures the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds Serious cat.color, wcag2aa, wcag143, TTv5, TT13.c, EN-301-549, EN-9.1.4.3, ACT failure, needs review afw4f7, 09o5cg definition-list Ensures elements are structured correctly Serious cat.structure, wcag2a, wcag131, EN-301-549, EN-9.1.3.1 failure dlitem Ensures and elements are contained by a Serious cat.structure, wcag2a, wcag131, EN-301-549, EN-9.1.3.1 failure document-title Ensures each HTML document contains a non-empty element Serious cat.text-alternatives, wcag2a, wcag242, TTv5, TT12.a, EN-301-549, EN-9.2.4.2, ACT failure 2779a5 duplicate-id-aria Ensures every id attribute value used in ARIA and in labels is unique Critical cat.parsing, wcag2a, wcag412, EN-301-549, EN-9.4.1.2
2025-04-02With a default "undefined" value indicating the state or property is not relevant.ID referenceReference to the ID of another element in the same documentID reference listA list of one or more ID references.integerA numerical value without a fractional component.numberAny real numerical value.stringUnconstrained value type.tokenOne of a limited set of allowed values.Widget attributesaria-autocompleteIndicates whether user input completion suggestions are provided.Values: ValueConditioninlineThe system provides text after the caret as a suggestion for how to complete the field.listA list of choices appears from which the user can choose, but the edit box retains focus.bothA list of choices appears and the currently selected suggestion also appears inline.noneNo input completion suggestions are provided.aria-checked - (state)Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. See related aria-pressed and aria-selected.Values: ValueConditiontrueThe element is selected.falseThe element is not selected.mixedThe element indicates both selected and unselected states.aria-current - (state)Indicates the element that represents the current item within a container or set of related elements. The aria-current attribute is used when an element within a set of related elements is visually styled to indicate it is the current item in the set.Values: ValueConditionpageRepresents the current page within a set of pages.stepRepresents the current step within a process.locationRepresents the current location within an environment or context.dateRepresents the current date within a collection of dates.timeRepresents the current time within a set of times.trueRepresents the current item within a set.false(default) Does not represent the current item within a set.aria-disabled - (state)Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. See related aria-hidden and aria-readonly.Values: aria-expanded - (state)Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.Values: aria-haspopupIndicates that the element has a popup context menu or sub-level menu.Values: aria-hidden - (state)Indicates that the element and all of its descendants are not visible or perceivable to any user as implemented by the author. See related aria-disabled.Values: aria-invalid - (state)Indicates the entered value does not conform to the format expected by the application.Values: ValueConditiontrueThe element is selected.falseThe element is not selected.grammarA grammatical error has been detected.spellingA spelling error has been detected.aria-labelDefines a string value that labels the current element. See related aria-labelledby.Values: aria-levelDefines the hierarchical level of an element within a structure.Values: aria-multilineIndicates whether a text box accepts multiple lines of input or only a single line.Values: aria-multiselectableIndicates that the user may select more than one item from the current selectable descendants.Values: aria-orientationIndicates whether the element and orientation is horizontal or vertical.Values: ValueConditionverticalThe element is oriented vertically.horizontal(default)The element is not selected.grammarThe element is oriented horizontally.aria-pressed - (state)Indicates the current "pressed" state of toggle buttons. See related aria-checked and aria-selected.Values: aria-readonlyIndicates that the element is not editable, but is otherwise operable.
2025-04-05