Overview
NDS icons come from HugeIcons, a free icon library, in its Stroke Rounded style: outline icons drawn with rounded line ends. Each icon takes the size and color of the text around it, so it matches the content it sits beside.
Icons come in two forms. Font icons give access to the full library of 6,228 icons, for page content such as cards, lists and feature grids. UI icons are a smaller set built into NDS, for interface controls such as buttons, menus and navigation. NDS also includes a few marks that HugeIcons does not offer, such as the Saudi riyal symbol and the app store logos.
Pick another component when:
- the icon sits in a tinted circle or square: Featured Icons
- the icon shows a status, such as success or error: Feedback Icons
Markup
An icon is one <i> element. A font icon takes any name from the HugeIcons library. A UI icon takes a name from the catalog below. Where an icon goes in a component, such as before a label, is on that component’s page.
UI Icon Catalog
Click a tile to copy its markup.
Custom Marks
Components paint some of these marks, such as the avatar placeholder and the checkbox tick. A mark is not the HugeIcons glyph of the same name: nds-icon-riyal and hgi-riyal differ.
Variants
Change the glyph name to the one you need: a font name from hugeicons.com, or a UI name from the catalog. Size and color go in the icon’s style, or on a parent: the icon takes both from its text.
| Group | Option | Markup | On element | Use |
|---|---|---|---|---|
| Structure | Font icon (default) | — | — | An icon from the font, for page content: cards, lists, feature grids and text |
| Structure | UI icon | canon #icons-ui |
— | An icon from the catalog, for controls and page chrome |
| Glyph | Search (default) | .nds-hgi-search-01 |
.nds-icon |
A sample glyph. Write the name you need |
| Glyph | Next (hint: Points forward: left in Arabic, right in English) | .nds-hgi-arrow-next-01 |
.nds-icon |
The forward arrow. See Logical Arrows |
| Glyph | Back (hint: Points back: right in Arabic, left in English) | .nds-hgi-arrow-prev-01 |
.nds-icon |
The back arrow. See Logical Arrows |
| Size | None (default) | — | — | The size of the text around it |
| Size | 32px | font-size: 32px; |
i |
A larger icon. Set it on a parent to size the icon and its text together |
| Size | 48px | font-size: 48px; |
i |
A large icon on its own, such as in an empty state |
| Color | None (default) | — | — | The color of the text around it |
| Color | Primary | color: var(--icon-primary); |
i |
The brand primary color |
| Color | Success | color: var(--icon-success); |
i |
A success mark |
| Color | Info | color: var(--icon-info); |
i |
An information mark |
| Color | Warning | color: var(--icon-warning); |
i |
A warning mark |
| Color | Error | color: var(--icon-error); |
i |
An error mark |
Behavior
Logical Arrows
The next and back arrows follow the reading direction. nds-hgi-arrow-next-01 points left on an Arabic page and right on an English one, and nds-hgi-arrow-prev-01 points the other way. The -01 arrows are chevrons, and the -02 arrows have a shaft.
Glyph Swap
An nds-icon draws the glyph set in --nds-icon, and each UI icon has a token, --nds-icon-{name}. Set --nds-icon to a token in your CSS to change the glyph, with no change to the markup. Set it on the icon itself: the icon’s own class sets it there, so a value on a parent does not reach it.
Built-in Features
-
Self-Hosted
The font and the icon CSS ship with NDS and load from your own domain. No request goes to a third party.
-
Off the Critical Path
The page never waits on an icon to show. The UI icon CSS loads right after the main CSS, so a close button or a menu arrow shows with the page. The font loads after the page shows.
-
On-Demand Font Files
The font comes in small files of 25 icons each. A page downloads only the files that hold its icons, not the full library.
-
Stable UI Set
A UI icon is an SVG copy inside the NDS CSS. A font update does not change it, and NDS can adjust a drawing, such as an arrow that flips with the reading direction.
-
Flash-Free Rendering
Icons stay hidden until they can paint, so a fallback box never shows. While the font loads, a font icon holds an empty box at its final size, so the layout does not move.
-
Color and Size Inheritance
An icon is a square one em wide, in the current text color. It matches the text around it with no extra class.
Best Practices
- Use the font for a glyph the catalog does not have: no other UI names exist.
- A font icon works in a button, but the button’s success or error status swaps only a UI icon. Use a UI icon in a button that shows a status.
- Write a UI icon as an
<i>element. Its CSS matches onlyi.nds-icon, so a<span>shows nothing. - Copy a name exactly, with its number:
hgi-arrow-left-01, nothgi-arrow-left. A name that does not exist shows nothing. - Use the next and back arrows for forward and back. Use the left and right arrows only for a fixed direction, such as a map: they always point where their name says.
- Size an icon with
font-size, notwidthandheight. Let its color come from the text around it. - Add
aria-hidden="true"to an icon beside a label. An icon-only control still needs a name for screen readers: its component page shows how. - Take icons from the free Stroke Rounded style only. The solid, bulk, duotone, twotone and sharp styles need a HugeIcons Pro license.
API
Classes
| Class | Element | Effect |
|---|---|---|
hgi-stroke |
<i> |
Sets the HugeIcons font. Write it with hgi before it, as every NDS page does |
hgi-{name} |
i.hgi-stroke |
The glyph: any name in the Stroke Rounded set |
nds-icon |
<i> |
A box one em square that paints the glyph as a mask in the text color |
nds-hgi-{name} |
i.nds-icon |
A UI glyph from HugeIcons. Only the names in the catalog above exist |
nds-icon-{name} |
i.nds-icon |
A mark drawn for NDS, such as nds-icon-riyal or nds-icon-apple. Two have other names: nds-pilcrow-left and nds-pilcrow-right |
CSS Custom Properties
| Property | Default | Controls |
|---|---|---|
--nds-icon |
set by the nds-hgi- or nds-icon- class |
The mask an nds-icon paints. Set it to a token to change the glyph. See Glyph Swap above |
--nds-icon-{name} |
an SVG data URI | One token per UI icon, such as --nds-icon-view-off. Use it as the value of --nds-icon |
License
The font and the UI icons from HugeIcons are under the MIT License, Copyright (c) 2025 Hugeicons. The marks drawn for NDS are under the MIT License as part of NDS. The MIT License permits commercial use, changes and redistribution. The HugeIcons notice ships in the NDS LICENSE file, so it goes wherever the icons go. Your pages need no credit line.