On this page
An icon-only link can look clear while giving a screen-reader user no useful name—or while pointing to the wrong page. To audit accessible links with SVG icons, check both what assistive technology announces and what happens when the link is activated.
Key Takeaways
- Give every link a meaningful accessible name; the shape of an icon alone is not a label.
- When adjacent text or an anchor label already names the link, hide a decorative inline SVG from assistive technology.
- Check the computed name, keyboard focus, screen-reader announcement, and actual destination. None of these checks replaces the others.
- Treat linked logos as links: their names should identify the organization or destination, not merely say “logo.”
How linked SVGs are exposed
A link’s accessible name is the text assistive technology uses to identify it. Depending on the markup, it can come from an anchor’s aria-label, visible link text, alternative text on an image inside the link, or other naming content. An inline SVG may itself be exposed as a graphic and may contribute a name, but the result can vary with markup, browser, and assistive technology.
For predictable results, name the anchor or provide appropriate text within it. If the SVG is only decorative, hide it from the accessibility tree. If it is an <img>, use an empty alt when the link already has a name from visible text or an anchor label. Don’t hide the only content that gives the link its name.
The W3C WAI guidance and SVG documentation requested for this article were not available to consult in this run. Check the applicable guidance and test the browser and assistive-technology combinations used by your audience. The examples below have not been executed.
Advertisement
Choose a naming pattern
The paths and asset name in these snippets are illustrative. Replace them with routes and assets that exist in your application. The inline shapes are examples; use the appropriate icon for your design.
Icon-only link with an inline SVG
<a href="/account" aria-label="Account settings">
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="24" height="24">
<circle cx="12" cy="8" r="4"></circle>
<path d="M4 21c0-5 3-8 8-8s8 3 8 8"></path>
</svg>
</a>
The anchor has the name “Account settings”; the SVG is decorative. focusable="false" is included as a compatibility precaution for SVG focus behavior. Make sure the destination really is the account settings page. A generic label such as “icon” would not explain the link’s purpose.
Icon accompanied by visible text
<a href="/guides">
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="24" height="24">
<path d="M4 3h12a4 4 0 0 1 4 4v14H8a4 4 0 0 0-4 0z"></path>
</svg>
<span>Browse guides</span>
</a>
Here, the visible text names the link. Avoid adding an SVG title such as “book icon” that could be announced unnecessarily or contribute confusing text to the name. Also avoid an aria-label that differs from the visible text: it can override that text as the accessible name and make the control harder to find by voice.
Linked logo using an SVG image
<a href="/">
<img src="/assets/brand.svg" alt="Example Company home">
</a>
If the image is the only content of the link, its alternative text can name the link. Describe the destination or purpose in context; “logo” alone is usually not enough. If the organization name and “Home” are already visible inside the same link, use alt="" for the decorative image instead, and check that the remaining text gives the link a useful name.
Audit the name and keyboard behavior
- Inspect the markup. Find the
<a>and confirm it has anhref. Identify the name source: visible text,aria-label, or image alternative text. Check that a decorative inline SVG hasaria-hidden="true"and that an image intended to be decorative hasalt="". - Inspect the accessibility tree. Select the link in your browser’s developer tools and open its accessibility inspection panel. Check that its role is link and its computed name describes the destination. Panel names and locations differ by browser. Look for unwanted words from SVG titles or image alternatives, and for an SVG exposed separately when it should be decorative.
- Use the keyboard. Starting before the navigation, press Tab to reach each link and Shift+Tab to move backward. Confirm focus follows a usable order and is clearly visible against its surroundings. Press Enter on the focused link and check the result. Test at the zoom levels and themes your site supports; don’t rely on hover styling as a focus indicator.
- Use a screen reader. With a screen reader enabled, move through the navigation using its normal reading and link-navigation commands, then focus and activate each link. Confirm the link has a meaningful name and that the icon does not cause a confusing extra announcement. Exact announcements and commands vary by product and settings. Check a link list if your screen reader offers one: names should make sense even when heard without nearby context.
- Check after activation. Confirm the resulting page or section is the intended one. For client-side navigation, also check that focus and announcements make the change understandable; a correct URL alone does not prove the transition is accessible.
Advertisement
Verify the destination
Compare each link’s intended purpose with both its resolved URL and its behavior:
- Inspect the anchor’s
hrefin developer tools. A relative path resolves against the document’s base URL, which may be affected by a<base>element. - Copy the link address or inspect the resolved
hrefproperty to check the host, path, query, and fragment. Confirm a fragment points to the intended section. - Activate the link with Enter, then check the resulting location and content. This catches redirects and JavaScript behavior that an attribute inspection alone can miss.
- Check any state-dependent links, such as signed-in navigation, in the relevant states. If a destination opens a new tab or triggers a download, make that behavior understandable to users.
Use a test environment or accounts authorized for the review. Avoid submitting private URLs or credentials to third-party checking tools.
Common Mistakes
- Assuming a recognizable icon has a name. A visual house or magnifying glass does not automatically communicate “Home” or “Search” to a screen reader.
- Hiding the only label. An icon-only link with
aria-hidden="true"on its SVG still needs a name on the anchor or another appropriate text source. - Naming both the link and its decorative graphic. Extra image alternative text or an SVG title may produce an unintended name or an additional announcement. Inspect and listen rather than assuming the result.
- Using a button for navigation or a link without a destination. Use a link with an
hreffor navigation; use a button for an action that does not navigate. - Checking only the accessibility tree. A good computed name does not establish that the link has visible focus or reaches the right destination.
Best Practices
Prefer visible link text when the design allows it. For icon-only controls, use a concise name that describes the destination or purpose, and keep it consistent with the actual route. Recheck after changing icons, labels, routes, or client-side navigation. Record the browser, screen reader, and test conditions so reviewers can reproduce any issue.
Conclusion
Audit each linked SVG as part of the whole link: verify its name, keyboard and screen-reader behavior, and destination. Keep decorative graphics out of the name, but never remove the link’s only useful label.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.