Accessibility in Blazor Tooltip Component

10 Jun 20243 minutes to read

The Blazor Tooltip component followed the accessibility guidelines and standards, including ADA, Section 508, WCAG 2.2 standards, and WCAG roles that are commonly used to evaluate accessibility.

The accessibility compliance for the Blazor Tooltip component is outlined below.

Accessibility Criteria Compatibility
WCAG 2.2 Support Yes
Section 508 Support Yes
Screen Reader Support Yes
Right-To-Left Support Yes
Color Contrast Yes
Mobile Device Support Yes
Keyboard Navigation Support Yes
Axe-core Accessibility Validation Yes
Yes - All features of the component meet the requirement.
Partial - Some features of the component do not meet the requirement.
No - The component does not meet the requirement.

WAI-ARIA attributes

The Blazor Tooltip component followed the WAI-ARIA patterns to meet the accessibility. The following ARIA attributes are used in the Tooltip component.

Attributes Purpose
role=”tooltip” The element that serves as the container for the tooltip has the ARIA role of tooltip.
aria-describedby This attribute is added to the target element on which the Tooltip gets opened, when focusing or hovering over it. It usually holds the randomly generated Id value of the Tooltip element.

In case, the target element already holds an aria-describedby attribute with Id value of some other component, then the Tooltip Id value can be additionally appended to the existing aria-describedby attribute separated by a space as shown in the example below.

For example:
aria-describedby = “my-text my-tooltip”
my-text is the Id of some other component.
my-tooltip is the id of Tooltip component.

When the Tooltip is closed, the aria-describedby attribute is removed from the target.
aria-hidden This attribute is assigned to the Tooltip element whose default value is true.

When true, it denotes that the Tooltip element is in a hidden or a closed state. When the Tooltip appears on the screen, it’s value changes to false.

Keyboard interaction

The Blazor Tooltip component followed the keyboard interaction guideline, making it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation. The following keyboard shortcuts are supported by the Tooltip component.

Keyboard shortcuts Actions
Escape Closes or dismisses the Tooltip.
Tab A form control receiving focus (say through tab key), opens the Tooltip, and on focus out closes it.

Ensuring accessibility

The Blazor Tooltip component’s accessibility levels are ensured through an axe-core software tool during automated testing.

The accessibility compliance of the Tooltip component is shown in the following sample. Open the sample in a new window to evaluate the accessibility of the Tooltip component with accessibility tools.

See also