Toast Component Accessibility

26 Jun 20244 minutes to read

The Toast control has been designed with WAI-ARIA specifications in mind by applying the prompt WAI-ARIA roles, states, and properties with the keyboard support. It helps users who use assistive WAI-ARIA accessibility support, which is achieved using attributes.

It provides information about the elements in a document for assistive technology.

The Toast control implements the keyboard navigation support by using the following WAI-ARIA practices and is tested in major screen readers.

The Toast 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 Toast 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 Not Applicable
Accessibility Checker Validation Yes
Axe-core Accessibility Validation Yes
Yes - All features of the component meet the requirement.
Intermediate - Some features of the component do not meet the requirement.
No - The component does not meet the requirement.

WAI-ARIA attributes

Class Description
role alert:
       Identifies the element as a container when alert content will be added or updated.
<div class="control-section">
      @Html.EJS().Toast("element").Title("Matt sent you a friend request").Content("You have a new friend request yet to accept").Render()
</div>
    <script type="text/javascript">
        setTimeout(
            () => {
                var toastObj = document.getElementById('element').ej2_instances[0];
                toastObj.target = document.body;
                toastObj.show();
            }, 1000);

    </script>
public class HomeController : Controller
{
    public ActionResult Index()
    {
        return View();
    }
}

Ensuring accessibility

The Toast component’s accessibility levels are ensured through an accessibility-checker and axe-core software tools during automated testing.

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

See also