Accessibility
17 Feb 20221 minute 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.
ARIA attributes
Class | Description |
---|---|
role |
alert: Identifies the element as a container when alert content will be added or updated. |
<ejs-toast id="element" title="Matt sent you a friend request" content="You have a new friend request yet to accept"></ejs-toast>
<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();
}
}