Skip to content

[EuiLoading] Accessibility props #4814

@j-m

Description

@j-m

Summary

EuiLoading needs to better communicate it's state to assistive tech. We can improve the component in two ways:

  1. First, add role="progressbar" and a default aria-label value to the loading state
  2. Also, accept a child to handle properly setting aria-busy

Details

Doing the first, improves the existing usage of the component. Doing the second, is a non-breaking API change that should better handle a more ideal UX.

For existing implementations, or for those that can't/don't want to upgrade to the new pattern, we should provide better documentation around aria-label and aria-busy

Documentation on aria-label should largely ask that something better than "loading content" be passed in.

Documentation on aria-busy should talk about where to put it (around the loading content) and give warnings on how it works (that it treats all children as aria-hidden) so devs don't overuse it.

In addition to accepting children to handle the aria-busy attribute setting, it'll need to also accept an isLoading prop (which is required if children are passed in).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions