github bed internet explorer heart book

How do assistive technologies handle Font Awesome?

This document lists different options to SVG icons—SVGs supplied by Font Awesome on this page—accessible. It also lists the limitations of those options. Because these are just examples; all links are internal (they don't go anywhere).

Note 1: Internet Explorer is giving SVGs a tab index. We have not set the "focusable" attribute to "no", but doing so would stop this behaviour.

Note 2: tests done with NVDA are using the latest version as of this testing date, 28 December 2015.

Test one: aria-hidden on the icon

We can hide the icon from assistive technologies (AT for short) by adding aria-hidden. This will however not convey the meaning—or any other information it carries—to users of AT.

Example

The link in this example has an icon of a bed before the text "Book a hotel". The icon is however hidden for AT with aria-hidden.

Book a hotel

<svg viewBox="0 0 100 100" class="fa fa-bed" aria-hidden="true"><use xlink:href="#fa-bed"></use></svg>

Results

AT, Browser, OS Test Result Expected Result Actual Result Caret navigation
VO to be tested... - Book a hotel - -
Orca 3.18, Firefox 42, Ubuntu 14.04 Pass Book a hotel link Book a hotel link B-o-o-k a h-o-t-e-l
JAWS 16, Firefox 43, Windows 7 Pass link Book a hotel link Book a hotel B-o-o-k a h-o-t-e-l
JAWS 16, IE 11, Windows 7 Pass link Book a hotel link Book a hotel B-o-o-k a h-o-t-e-l
NVDA (latest), IE 11, Windows 7 Pass link Book a hotel link Book a hotel b-o-o-k a h-o-t-e-l
NVDA (latest), Firefox 43, Windows 7 Pass link Book a hotel link Book a hotel b-o-o-k a h-o-t-e-l

Issues

Test two: visually hidden text and aria-hidden on the icon

Besides hiding the icon from AT, we can also provide visually hidden text that describes the icon or conveys its meaning. This example uses the popular sr-only class to mark an elment as "for screen readers only".

Example

The link in this example shows the GitHub logo without text. The icon is hidden for AT with aria-hidden and there is alternative text provided via the sr-only class.

GitHub

<svg viewBox="0 0 100 100" class="fa fa-github" aria-hidden="true"><use xlink:href="#fa-github"></use></svg>
<span class="sr-only">GitHub</span>

Results

AT, Browser, OS Test Result Expected Result Actual Result Caret navigation
VO to be tested... - Github - -
Orca 3.18, Firefox 42, Ubuntu 14.04 Pass Github link Github link G-i-t-h-u-b
JAWS 16, Firefox 43, Windows 7 Pass link Github link Github G-i-t-h-u-b
JAWS 16, IE 11, Windows 7 Pass link Github link Github G-i-t-h-u-b
NVDA (latest), IE 11, Windows 7 Pass link Github link Github g-i-t-h-u-b
NVDA (latest), Firefox 43, Windows 7 Pass link Github link Github g-i-t-h-u-b

Issues

Test three: aria-label on the icon

We can provide alternative text for the icon to AT by adding aria-label.

Example

The link in this example has an icon of a book followed by the word "shop". The icon has an aria-label with a value of "book" to communicate "book shop" to AT.

shop

<svg viewBox="0 0 100 100" class="fa fa-book" aria-label="Book"><use xlink:href="#fa-book"></use></svg>

Results

AT, Browser, OS Test Result Expected Result Actual Result Caret navigation
VO to be tested... - Book shop - -
Orca 3.18, Firefox 42, Ubuntu 14.04 Fail Book shop link shop link s-h-o-p
JAWS 16, Firefox 43, Windows 7 Fail link Book shop link shop s-h-o-p
JAWS 16, IE 11, Windows 7 Fail link Book shop link shop s-h-o-p
NVDA (latest), IE 11, Windows 7 Buggy link Book shop book graphic link shop unable to test*
NVDA (latest), Firefox 43, Windows 7 Fail link Book shop link shop s-h-o-p

Issues

Test four: aria-label and role=img on the icon

We can add alternative text via aria-label, but as Joanie explained this won't influence the icon node type—which is still a text node; this causes issues because it allows for AT caret navigation (navigate text per character). We can work around this by adding role="img"; this turn the text node into a graphical node and thus disabled caret navigation.

Example

The icon in the next paragraph shows a heart, but it replaces the word "love" in the sentence. If we follow the alternative text guidelines for informative images we should use a literal description:

In some situations a detailed literal description may be needed, but only when the content of the image is all or part of the conveyed information.

Every cool web project is made with these days. (And so is this one).

<svg viewBox="0 0 100 100" role="img" aria-label="love" class="fa fa-heart"><use xlink:href="#fa-heart"></use></svg>

Results

AT, Browser, OS Test Result Expected Result Actual Result Caret navigation
VO to be tested... - love image - -
Orca 3.18, Firefox 42, Ubuntu 14.04 Fail love image no pause, as if nothing there no characters
JAWS 16, Firefox 43, Windows 7 Fail graphic love no pause, as if nothing there no characters
JAWS 16, IE 11, Windows 7 Fail graphic love empty newline announced, pause heard when tabbing newline only
NVDA (latest), IE 11, Windows 7 Pass graphic love graphic love l-o-v-e
NVDA (latest), Firefox 43, Windows 7 Fail graphic love no pause, as if nothing there no characters

Issues

Test five: rely on title tag in icon

SVGs can have a title tag. This information should be used in the name calculation.

Example

Icon is used as a replacement for the words: internet explorer. Here, the title is referenced from within a <use> tag using xlink:href to reference it.

is the best.

<svg viewBox="0 0 100 100" class="fa fa-ie"><use xlink:href="#fa-internet-explorer"></use></svg>

Results

AT, Browser, OS Test Result Expected Result Actual Result Caret navigation
VO to be tested... - Internet Explorer is the best - -
Orca 3.18, Firefox 42, Ubuntu 14.04 Fail Internet Explorer is the best nothing announced (except the plain text "is the best") no characters (from SVG)
JAWS 16, Firefox 43, Windows 7 Fail Internet Explorer is the best nothing announced no characters
JAWS 16, IE 11, Windows 7 Fail Internet Explorer is the best nothing announced no characters
NVDA (latest), IE 11, Windows 7 Fail Internet Explorer is the best nothing announced no characters
NVDA (latest), Firefox 43, Windows 7 Fail Internet Explorer is the best nothing announced no characters

Issues

Test six: rely on title tag in icon inside interactive element

Same as test number 5, but inside an interactive element within the SVG.

Example

Icon is used as a replacement for the words: internet explorer.

Download .

<svg viewBox="0 0 100 100" class="fa fa-ie"><a xlink:href="#void"><use xlink:href="#fa-internet-explorer"></use></a></svg>

Results

AT, Browser, OS Test Result Expected Result Actual Result Caret navigation
VO to be tested... - Download Internet Explorer - -
Orca 3.18, Firefox 42, Ubuntu 14.04 Fail Download Internet Explorer nothing announced (except the plain text "Download") no characters (from SVG)
JAWS 16, Firefox 43, Windows 7 Fail Download Internet Explorer "link number void" (the contents of the href string) no characters
JAWS 16, IE 11, Windows 7 Fail Download Internet Explorer nothing announced, makes 2 tab stops no characters
NVDA (latest), IE 11, Windows 7 Fail Download Internet Explorer "Download graphic graphic dot", announces "graphic graphic" when tabbing no characters
NVDA (latest), Firefox 43, Windows 7 Fail Download Internet Explorer "Download dot" (that is, the SVG being there makes NVDA see the . as a loose character) no characters

Issues

Test seven: use direct title tag in icon

Here we use a direct <title> tag in the SVG. With this tag in the SVG we could additionally add an id to the title and reference the SVG itself to the title using aria-labelledby (which we do not do here) as described by Léonie Watson.

Example

Icon is used as a replacement for the words: internet explorer.

internet explorer is awesome.

<svg viewBox="0 0 1024 1024" style="width:1em;height:1em;"><title>internet explorer</title> <path class="path1" d="M1024 535.429q0 32-4 59.429h-657.714q0 83.429 62.571 139.714t147.143 56.286q56.571 0 106-26.571t78-74.571h241.714q-32 90.857-97.429 160.571t-152.857 107.714-183.429 38q-106.857 0-203.429-47.429-130.286 66.286-225.143 66.286-135.429 0-135.429-150.286 0-65.714 25.714-157.143 9.714-34.286 62.286-130.857 113.714-205.714 271.429-346.286-105.143 45.143-244 202.286 36-156.571 162-256.857t286.571-100.286q17.143 0 25.714 0.571 145.714-66.857 247.429-66.857 36.571 0 66.286 7.429t54 23.143 38 43.714 13.714 65.714q0 66.286-42.857 163.429 57.714 104 57.714 222.857zM984 169.714q0-47.429-30.286-75.429t-78.286-28q-61.714 0-145.143 40 69.143 26.857 127.143 75.143t97.429 111.714q29.143-77.143 29.143-123.429zM73.143 876.571q0 49.143 27.714 75.714t76.857 26.571q65.714 0 152-47.429-69.714-41.143-122-104.571t-78.571-140q-56 117.143-56 189.714zM361.143 469.143h416q-2.857-81.143-64.571-135.429t-143.429-54.286q-82.286 0-143.714 54.286t-64.286 135.429z"></path></svg>

Results

AT, Browser, OS Test Result Expected Result Actual Result Caret navigation
VO to be tested... - Internet Explorer is awesome - -
Orca 3.18, Firefox 42, Ubuntu 14.04 Fail Internet Explorer is awesome nothing announced (except the plain text "is awesome") no characters (from SVG)
JAWS 16, Firefox 43, Windows 7 Fail graphic Internet Explorer is awesome nothing announced no characters
JAWS 16, IE 11, Windows 7 Pass graphic Internet Explorer is awesome "graphic internet explorer" i-n-t-e-r-n-e-t e-x-p-l-o-r-e-r
NVDA (latest), IE 11, Windows 7 Buggy Internet Explorer is awesome "graphic internet explorer graphic internet explorer", announces "graphic graphic" when tabbing i-n-t-e-r-n-e-t e-x-p-l-o-r-e-r but twice
NVDA (latest), Firefox 43, Windows 7 Fail Internet Explorer is awesome nothing announced no characters

Issues