When using icons in your UI, there are manual techniques and ways to help assistive technology either ignore or better understand {{ site.forkawesome.name }}.
If you're using an icon to add some extra decoration or branding, it does not need to be announced to users as they are navigating your site or app aurally. Additionally, if you're using an icon to visually re-emphasize or add styling to content already present in your HTML, it does not need to be repeated to an assistive technology-using user. You can make sure this is not read by adding the aria-hidden="true"
to your {{ site.forkawesome.name }} markup.
If you're using an icon to convey meaning (rather than only as a decorative element), ensure that this meaning is also conveyed to assistive technologies. This goes for content you're abbreviating via icons as well as interactive controls (buttons, form elements, toggles, etc.). There are a few techniques to accomplish this:
The simplest way to provide a text alternative is to use the aria-hidden="true"
attribute on the icon and to include the text with an additional element, such as a <span>
, with appropriate CSS to visually hide the element while keeping it accessible to assistive technologies. In addition, you can add a title
attribute on the icon to provide a tooltip for sighted mouse users.
In the case of focusable interactive elements, there are various options to include an alternative text or label to the element, without the need for any visually hidden <span>
or similar. For instance, simply adding the aria-label
attribute with a text description to the interactive element itself will be sufficient to provide an accessible alternative name for the element. If you need to provide a visual tooltip on mouseover/focus, we recommend additionally using the title
attribute or a custom tooltip solution.