Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion docs/api/icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,28 @@ For more information, including styling and all available icons, see <a href="ht

import Basic from '@site/static/usage/v7/icon/basic/index.md';

<Basic />
<Basic />


## Accessibility

Icons that are purely decorative content should have <code>aria-hidden="true"</code>. This will not visually hide the icon, but it will hide the element from assistive technology.

```html
<ion-icon name="heart" aria-hidden="true"></ion-icon>
```


If the icon is interactive, it should have alternate text defined by adding an <code>aria-label</code>.

```html
<ion-icon name="heart" aria-label="Favorite"></ion-icon>
```

Alternatively, if the icon is inside of another element that it is describing, that element should have the <code>aria-label</code> added to it, and the icon should be hidden using <code>aria-hidden</code>.

```html
<ion-button aria-label="Favorite">
<ion-icon name="heart" aria-hidden="true"></ion-icon>
</ion-button>
```