---
title: "Accessible Icons: aria-label, Contrast and WCAG Rules"
description: "How to make icons accessible: hide decorative icons, name icon-only buttons, give meaningful icons 3:1 contrast and visible labels. WCAG 2.2 rules with code."
url: https://pikaicons.com/blog/icon-accessibility
---

[Blog](https://pikaicons.com/blog) Guides

# Accessible icons: labels, contrast and the code for each case

![An eye icon with a purple check badge on its corner](https://pikaicons.com/images/blog/icon-accessibility/cover-079d15b6.png)

Ash 5 December 2026 7 min read

An accessible icon starts with one question: what is it doing? A **decorative** icon sits beside text that already says the same thing, so hide it from screen readers with `aria-hidden="true"`. An **informative** icon carries meaning on its own, like a status marker in a table, so give it a text alternative and at least 3:1 contrast. An **interactive** icon is the only content of a button or link, so the button needs an accessible name, usually through `aria-label`, and a target of at least 24 by 24 CSS pixels.

Behind all three sits the advice that helps everyone, including people who never use a screen reader: put a visible text label next to the icon wherever there's room.

Get 900+ free icons, no account needed

Copy them as SVG or code in the web app, free for personal and commercial use.

[Browse the free icons](https://icon.pikaicons.com/?category=free)

* [![Eye icon](https://pikaicons.com/icons/free/stroke/eye-on.svg)](https://pikaicons.com/icon/eye-on "Eye icon")
* [![Eye Off icon](https://pikaicons.com/icons/free/stroke/eye-off.svg)](https://pikaicons.com/icon/eye-off "Eye Off icon")
* [![Speaker On icon](https://pikaicons.com/icons/free/stroke/speaker-on.svg)](https://pikaicons.com/icon/speaker-on "Speaker On icon")
* [![Volume icon](https://pikaicons.com/icons/free/stroke/volume-two.svg)](https://pikaicons.com/icon/volume-two "Volume icon")
* [![Microphone icon](https://pikaicons.com/icons/free/stroke/mic-on.svg)](https://pikaicons.com/icon/mic-on "Microphone icon")
* [![Keyboard Wireless icon](https://pikaicons.com/icons/free/stroke/keyboard-wireless.svg)](https://pikaicons.com/icon/keyboard-wireless "Keyboard Wireless icon")
* [![Wheelchair icon](https://pikaicons.com/icons/free/stroke/wheelchair.svg)](https://pikaicons.com/icon/wheelchair "Wheelchair icon")
* [![Info icon](https://pikaicons.com/icons/free/stroke/information-circle.svg)](https://pikaicons.com/icon/information-circle "Info icon")

## The three kinds of icon, and the code for each

### Decorative: hide it

Most icons in a product sit next to words: a trash can beside "Delete", a gear beside "Settings". The text already gives the meaning, so a screen reader announcing the icon too would just add noise. Hide the icon and let the text speak.

```html
<button type="button">
  <svg aria-hidden="true" focusable="false">…</svg>
  Delete
</button>

```

`aria-hidden="true"` removes the icon from the accessibility tree. `focusable="false"` is for older browsers that could put an SVG in the tab order; it does no harm in current ones. Some icon libraries now do this by default: Lucide made `aria-hidden` the default for its icons in [version 1](https://lucide.dev/guide/version-1).

### Informative: give it a text alternative

An icon that carries meaning with no text beside it needs its own name. Typical cases are a green check in a status column, a warning sign in a form summary, or a lock beside a file name to say it's private.

```html
<svg role="img" aria-label="Private">…</svg>

```

`role="img"` makes the whole SVG one image, so a screen reader doesn't try to read its paths, and `aria-label` gives it a name. MDN documents the pattern under the [img role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/img%5Frole). Visually hidden text next to a hidden icon works just as well, and is easier to translate in some setups.

Under WCAG 2.2, this is [success criterion 1.1.1, Non-text Content](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html): non-text content needs a text alternative that serves the same purpose, and decorative content should be ignorable by assistive technology.

### Interactive: name the control

An icon-only button, like a close ×, a menu or a "more" button, has no text, so the button itself needs a name. Put it on the button and hide the icon inside.

```html
<button type="button" aria-label="Close dialog">
  <svg aria-hidden="true" focusable="false">…</svg>
</button>

```

Name the action, not the picture. "Close dialog" tells a screen reader user what happens; "X" or "Cross icon" doesn't. The same applies to links: a share icon that links to a sharing page needs a name like "Share this post".

When a button shows text too, its accessible name should contain that text. That's [success criterion 2.5.3, Label in Name](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html), and it matters for voice control users, who say what they see. An `aria-label` of "Remove item" on a button that shows "Delete" breaks the command "click Delete".

## Contrast: 3:1 for icons that carry meaning

Text needs 4.5:1 contrast, but icons fall under a separate rule. [Success criterion 1.4.11, Non-text Contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html), asks for at least 3:1 against adjacent colours for graphics that are required to understand the content and for what identifies a control or its state. W3C's own examples include a print icon with no text and status icons on a dashboard without text.

In practice:

* An icon-only button's icon needs 3:1 against its background, because it's the only thing that identifies the button.
* A decorative icon beside a text label doesn't, because the text carries the meaning. Pale decorative icons are allowed, though most interfaces look better with icons close to the text colour.
* An icon that shows state, like a filled star for "favourited" or a chevron that marks a dropdown, needs 3:1 for the part that shows the state.

Check icons in every theme you ship. Grey icons that pass on white often fail on a dark background, and the reverse.

## Don't let colour or shape alone carry the meaning

A red icon for "error" and a green one for "success" tell nothing to someone who can't tell red from green. [Success criterion 1.4.1, Use of Color](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html), says colour can't be the only way information is conveyed. Use different icons for different states (a check and an alert, not one circle in two colours), and pair them with words.

The same thinking applies to swapping an outline icon for a filled one to show selection. The change of shape helps, but a selected tab should also be marked in code, with `aria-selected` or `aria-current`, so assistive technology knows which one is active. [Outline vs filled icons](https://pikaicons.com/blog/outline-vs-filled-icons) covers the visual side.

## Target size for icon buttons

A 16 or 20px icon is too small to tap reliably, so the button around it needs padding. [Success criterion 2.5.8, Target Size (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html), asks for targets of at least 24 by 24 CSS pixels at level AA, with an exception for smaller targets that have enough space around them. Apple and Android recommend larger targets for touch. [Icon sizes](https://pikaicons.com/blog/icon-sizes#tap-targets-are-a-different-number) compares the numbers and shows them drawn to scale.

## Tooltips aren't labels

A tooltip on hover helps sighted mouse users learn what an icon means, but it doesn't help screen reader users unless the same text is the button's accessible name, and it never appears on a touch screen. Use a tooltip as a hint, keep the name in `aria-label` or visible text, and make the tooltip text match it.

If you do show tooltips, [success criterion 1.4.13, Content on Hover or Focus](https://www.w3.org/WAI/WCAG22/Understanding/content-on-hover-or-focus.html), asks that they can be dismissed without moving the pointer, that the pointer can move onto them without them vanishing, and that they stay until the user moves away.

## The label is the best accessibility feature

Most icons aren't as clear as designers hope. Nielsen Norman Group's [icon usability](https://www.nngroup.com/articles/icon-usability/) guidance says "a text label must be present alongside an icon to clarify its meaning", and that only a few icons, such as home, print and search, are widely recognised on their own. Its rule of thumb for designers: if it takes you more than five seconds to think of an icon for something, the icon is unlikely to communicate it.

A visible label helps people with cognitive disabilities, people using voice control, people new to your product and people reading in a second language, all at once. Keep icon-only buttons for the handful of actions everyone recognises, and for toolbars where space is tight and a tooltip explains the rest.

## Icon fonts need extra care

If you use an icon font, every icon is a character, and screen readers may read it out. Add `aria-hidden="true"` to every decorative font icon, and give meaningful ones visually hidden text. Users who override fonts for readability see boxes instead of icons, which is one of the reasons [icon fonts vs SVG](https://pikaicons.com/blog/icon-fonts-vs-svg) recommends SVG for new work.

## How to test your icons

* **Read the accessibility tree.** In Chrome or Firefox developer tools, the Accessibility panel shows each element's name and role. Every icon-only button should have a name, and decorative icons shouldn't appear.
* **Use a screen reader.** VoiceOver is built into macOS and iOS, and NVDA is free on Windows. Tab through the page and listen to what each button is called.
* **Turn the colours off.** A greyscale filter in your operating system shows whether states depend on colour alone.
* **Check contrast in each theme.** Measure icon colours against their real backgrounds, hover and selected states included.

## In code, with our icons

The free Pikaicons React package, [@pikaicons/react](https://www.npmjs.com/package/@pikaicons/react), hides every icon from assistive technology by default, and passing `aria-label` makes an icon announced instead. [SVG icons in React](https://pikaicons.com/blog/svg-icons-in-react#icons-a-screen-reader-should-hear) shows how to build the same behaviour into your own icon component, and there are 900+ [free icons](https://icon.pikaicons.com/?category=free) to try it with.

## Frequently asked questions

### How do I make an icon accessible?

Decide what it does. Hide decorative icons next to text with `aria-hidden="true"`. Give informative icons a text alternative, for example `role="img"` with `aria-label`. Give icon-only buttons an accessible name with `aria-label` on the button. Icons that carry meaning need 3:1 contrast against their background.

### Should icons have aria-hidden?

Yes, when the icon is decorative, meaning text next to it already says the same thing. Don't hide an icon that is the only content of a button without naming the button, or an icon that carries information no text gives.

### What contrast do icons need under WCAG?

At least 3:1 against adjacent colours, under success criterion 1.4.11, for icons required to understand content or to identify a control or its state. Decorative icons next to text are exempt.

### How do I label an icon-only button?

Put `aria-label` on the button with the action it performs, such as "Close dialog" or "Add to favourites", and add `aria-hidden="true"` to the icon inside it. A visible tooltip with the same text helps sighted users.

### Do icons need text labels?

Wherever there's room, yes. Usability research from Nielsen Norman Group found that only a few icons, such as home, print and search, are widely understood without a label. Visible labels help everyone, not only screen reader users.

### What size should an icon button be for accessibility?

At least 24 by 24 CSS pixels to meet WCAG 2.2 level AA, unless it has enough space around it. For touch, Apple recommends 44 by 44 points and Android 48 by 48 dp.

## Try Pikaicons in your own UI

The quickest way to judge an icon set is to drop it into your own interface. The 900+ free icons are yours to copy and ship, and the full library has 6,000+ icons across five styles for one payment from $99.

[Get Pikaicons](https://pikaicons.com/pricing) [Try the free icons](https://icon.pikaicons.com/?category=free)

Ash 5 December 2026

## More from the blog

* [Free icons for Figma, and how to set them up so they last The quickest way to get free icons into Figma is an official plugin or file from an open-source set. Here are the good ones, the license catch in Figma Community, and the setup that keeps icons easy to swap. Ash5 Dec 2026](https://pikaicons.com/blog/free-icons-for-figma)
* [Icon fonts vs SVG icons, and when a font still makes sense SVG has replaced icon fonts in most products, for reasons GitHub spelled out back in 2016\. Icon fonts still have two good uses, and a few traps if you keep one. Ash5 Dec 2026](https://pikaicons.com/blog/icon-fonts-vs-svg)
* [Icon licenses explained: client work, templates, open source and apps Using icons in your own app is allowed by nearly every license. Client handovers, templates you sell and public repositories are where licenses split, and where most people get it wrong. Ash5 Dec 2026](https://pikaicons.com/blog/icon-licenses-explained)
