Iconography principles
Great icons are, first and foremost, context-appropriate. Secondly, they are universal and well recognised. The goal is to use well-recognised icons consistently across all platforms, so that the same icon always means the same thing.
User
Represents the account of the signed-in user and access to its settings.
Magnifying glass
Represents search, or an action that opens or triggers a search.
Envelope
Represents a message, an email address or an inbox.
Gear
Represents the ability to manage preferences or settings.
Icon library
Clear, minimal and consistent is the goal, and for this reason Phosphor Icons has been selected for the design system. Phosphor is an open-source (MIT licensed) collection of 1,512 icons, each available in six weights: thin, light, regular, bold, fill and duotone, giving a total of 9,072 icons.
The design system components, such as callouts and toasts, use Phosphor icons themselves. Using the same library in your content keeps every icon on the page visually consistent with the components around it.
Using Phosphor icons
As inline SVG (recommended)
Inline SVG is the recommended method. It loads only the icons you use, needs no extra request, scales without loss of quality and inherits the text colour of its parent element.
- Visit Phosphor Icons and search for the icon you need.
- Select the weight that matches the text it accompanies (see Weights below).
- Select the icon, then copy the SVG code.
- Paste the SVG into your markup, size it with a utility class such as
size-6, and keepfill="currentColor"so the icon follows the text colour. - Add
aria-hidden="true"when the icon is decorative or sits next to a visible text label.
<a href="/search" class="inline-flex items-center gap-2">
<svg class="size-6" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 256 256" fill="currentColor">
<path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/>
</svg>
Search
</a>
As an image
At times it may be necessary to use an icon in an <img> tag rather than as an inline <svg>. Although this is not recommended, it may sometimes be unavoidable.
In such cases, reference the SVG file in the <img> tag so that the vector format and clarity are preserved. Note that an icon used as an image cannot inherit the text colour, so export it in the colour you need. Give it an empty alt="" when it is decorative, or a short description of its purpose when it conveys meaning on its own.
<!-- Decorative: the visible text already explains the link -->
<a href="/annual-report.pdf">
<img src="/icons/file-pdf.svg" alt="" width="24" height="24" />
Annual report 2024 (PDF, 2 MB)
</a>
<!-- Meaningful: the icon is the only content -->
<img src="/icons/warning.svg" alt="Warning" width="24" height="24" />
As a web font (CDN)
The library is also available as a hosted web font and CSS file. Phosphor maps each icon to a character in Unicode's Private Use Area, and a class name on an <i> element displays the icon.
This approach is convenient for prototypes, but each weight is a separate font file that contains every icon, so it adds weight to the page. If you use it, load only the weights you need, pin the version number, and hide the icons from assistive technology with aria-hidden="true".
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css"
href="https://unpkg.com/@phosphor-icons/web@2.1.2/src/regular/style.css" />
</head>
<body>
<button type="button">
<i class="ph ph-heart" aria-hidden="true"></i>
Add to favourites
</button>
</body>
</html>
Icon usage
- Match the text weight. The icon weight must correspond to the font weight of the text it accompanies. For example, regular (400) text uses the regular icon weight, and light (300) text uses the light icon weight.
- Use fill and duotone selectively. Use the fill weight to show a selected or active state, such as the current navigation item or a saved favourite. Use duotone for state icons and larger illustrative icons; it works particularly well in dark mode, and may be used in light mode when the colour tone keeps the look consistent.
- Prefer SVG. Vector icons give the best performance and the sharpest result at every size, and allow full control over size and colour.
Weights
Phosphor icons are drawn on a 256 × 256 grid. The regular weight uses a 16-unit stroke, which renders as a 1.5 px line at the default 24 px size. Choose the weight according to the font weight of the element the icon accompanies:
Size
The default icon size is 24 × 24 px, which pairs with the base body text size of 16 px. Increase the icon size in step with the text it accompanies, and go beyond 48 px only for state icons and empty states.
Success Criterion 2.5.8 Target Size (Minimum) requires interactive targets to be at least 24 × 24 CSS pixels. When an icon is the only content of a button or link, make the clickable area at least 24 × 24 px, even if the icon itself is smaller. Use the 20 × 20 px size sparingly, and only next to small text.
| Size | Class | Recommended use |
|---|---|---|
20 × 20 |
| Next to small text (14 px). Use sparingly. |
24 × 24 |
| Default. Body text (16 px), buttons, links and form fields. |
28 × 28 |
| Large text (18 px). |
32 × 32 |
| Feature lists and card headers. |
40 × 40 |
| Identity icon on service cards. |
48 × 48 |
| State icons, such as empty states and attachments. |
56 × 56 and 80 × 80 |
| Large empty states that fill a section or a full page. |
Colour
Icons inherit the colour of the text around them. We recommend limiting icon colours to the following combinations:
You can still use colour for specific icons in isolated frames or sections, such as services and initiatives. Success Criterion 1.4.11 Non-text Contrast requires icons that convey information to have a contrast ratio of at least 3:1 against their background.
Since contrast is the main concern, any high-contrast combination within the colour system is allowed. For example, you may use shade 100 of a core or secondary colour for the icon on a background of shade 700 or darker from the same colour.
Alignment
Although the canvas of an icon is square, the shape inside it is not always circular or square. Correct alignment keeps the layout clean when icons are placed next to each other or next to text.
- Centre-align same-sized icons on the vertical axis when they sit in a row or grid.
- Centre-align an icon vertically with the first line of the text it accompanies, and keep a consistent gap between the icon and the text (for example
gap-2for body text).
When to use icons
Use icons only when they help communication. In some scenarios an icon communicates the message effectively, while in others it may misrepresent your intention or not convey it at all. To avoid this, pick the icon that matches the exact action, not a similar one, and pair it with a text label or other visual aid.
Overuse of icons leads to distracting and visually overwhelming interfaces. Icons may be used for:
- Components, such as buttons, links and supporting calls to action.
- Navigation items or identifiers, such as the menu icon that opens the navigation.
- Header and supporting links, such as "Log in", "Search" or "Change language".
- Supporting links in the footer, such as social media links.
- Components such as ratings.
- List or sub-navigation identifiers.
- The identity of a service card.
- Help and contextual information.
- Status indicators, such as a loading state.
State icons
State icons are visual placeholders for different states, such as empty states, messages (for example "Nothing found" or "Turn on notifications") and attachments.
These icons are 48 × 48 px, usually use the bold or duotone weight, and must scale with the surrounding text. When the empty state fills an entire page or an edge-to-edge section, the icon may be larger, for example 80 × 80 px, and coloured to match the disabled state colour.
You have not added any family members as dependants yet.
Icon shapes
You can place icons inside buttons or simple containers that are square, rounded or circular. Irregular shapes, blobs and shapes based on your brand identity elements are not allowed, as they compete with the icon and break the consistency of the interface.
Duotone and two-tone icons
A duotone icon consists of a primary and a secondary layer. The secondary layer has an opacity of 20%, so it appears as a lighter shade of the icon colour. Because it inherits the same colour, a duotone icon works with any colour from the palette.
A two-tone icon also consists of a primary and a secondary layer, but the secondary layer uses a different colour shade instead of opacity. Two-tone icons work well with the secondary colour palette, and are recommended in small sections or to illustrate a process.
One colour; the secondary layer is the same colour at 20% opacity.
Two colours; the secondary layer uses a separate shade, here Sea blue 300 and 700.
Accessibility
Icons must work for everyone, including people who use screen readers, people with low vision and people with cognitive disabilities.
- Decorative icons that sit next to a visible text label add no information for screen reader users. Hide them with
aria-hidden="true". - Meaningful icons that appear without a visible label, such as an icon-only button, must have an accessible name. Add an
aria-labelto the button or link, and a tooltip so that sighted users can also confirm the action. - Do not rely on colour alone. When an icon communicates a status, such as success or error, pair it with text or a distinct shape so that users who cannot perceive the colour still understand the message.
- Provide a large enough target. Icon-only buttons and links must have a clickable area of at least 24 × 24 px.
<!-- Icon with a visible label: hide the icon -->
<button type="button">
<svg class="size-6" aria-hidden="true" ...></svg>
Download
</button>
<!-- Icon-only button: name the button -->
<button type="button" aria-label="Close dialog" title="Close dialog">
<svg class="size-6" aria-hidden="true" ...></svg>
</button>
Icons in right-to-left layouts
On Arabic (right-to-left) pages, icons that show direction or movement must be mirrored so that they point the way the content flows. This includes arrows, carets, "back" and "next" icons, and icons that show progress along a line.
Icons that represent real-world objects or universal symbols must not be mirrored, for example a clock, a magnifying glass, a check mark, a media play button or a brand logo. Mirroring these changes their meaning or makes them look wrong.
With Tailwind CSS, mirror a directional icon on right-to-left pages with the rtl:-scale-x-100 utility.
Mirror directional icons
In a right-to-left layout, "next" moves towards the left. A "next" button with an arrow pointing right sends the user the wrong way.
Basic principles of iconography
The following examples show best practices for using icons. They summarise the principles described throughout this guide.
Pair icons with text labels
Only a few icons, such as search, close and menu, are understood without a label. For every other action, show a visible text label next to the icon.
Do not mix icon weights
Icons in the same group, such as a toolbar, a list or a set of cards, must use the same weight and size. Mixing weights makes the interface look inconsistent.
Do not overuse icons
Adding an icon to every item turns icons into decoration and makes the important ones harder to notice. Use icons only where they help the user understand or find something.
- Renew your Emirates ID
- Register a new vehicle
- Pay traffic fines
- Apply for a trade licence
Do not use low-contrast icon colours
Icons that convey information must have a contrast ratio of at least 3:1 against their background.