7

In samples of Lightning design system I have seen a lot of aria-* attributes, for example:

<ul role="tree" aria-labelledby="treeheading" ...>

<button aria-controls="accordion-details-01" aria-expanded="true" ...>

<div aria-hidden="false" ...>

Can somebody explain me what is the purpose of using those in Lightning components and what is the difference if I just skip them?

10

The Accessible Rich Internet Applications specification provides accessibility features for disabled individuals, as stated in the RFC:

Accessibility of web content requires semantic information about widgets, structures, and behaviors, in order to allow assistive technologies to convey appropriate information to persons with disabilities. This specification provides an ontology of roles, states, and properties that define accessible user interface elements and can be used to improve the accessibility and interoperability of web content and applications. These semantics are designed to allow an author to properly convey user interface behaviors and structural information to assistive technologies in document-level markup.

You can skip these codes if you don't care about supporting accessibility for disabled individuals, particularly if it's for your own website or Lightning components you use internally in your org. However, if you're trying to sell an app to government entities and some other orgs, your app may not be recommended or possibly even rejected if it does not meet Section 508 Requirements (in the United States), or similar requirements that may be enforced by other governments around the world.

  • Do aria attributes change anything in user interaction? – vladdihoney Jun 21 '17 at 14:11
  • @VladyslavKushney It only changes the behavior for users that use assistive technology (screen readers, braille screens, etc). The majority of users will not notice or be affected by aria, but for a significant minority (about 25% of Internet users), their experience will be enhanced by the aria technology. – sfdcfox Jun 21 '17 at 14:19
  • So if my users interact with application only with mouse and keyboard and use regular form controls, aria is not necessary? – vladdihoney Jun 21 '17 at 14:23
  • 1
    @VladyslavKushney You should include them now, because if you wait until you need them, it's going to be more work. – sfdcfox Jun 21 '17 at 14:49
  • The conclusion I make is that it is for stakeholders to decide if they need support for accessibility, but I can hardly imagine decision making individuals with disabilities working with business processes I implement and I bet my stakeholders have no clue about such possibilities. So I consider them as not necessary for current projects. – vladdihoney Jun 21 '17 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.