Skip to main content
Login

Sign in to access your account

Icons - National Design System

Outline icons from the HugeIcons library, as a font with the full library for page content and a smaller built-in set for interface controls.

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:

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.

Options
Structure
Glyph
Size
Color
Preview
<i class="hgi hgi-stroke hgi-search-01" aria-hidden="true"></i>

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.

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.

/* Show the "hide" eye while the toggle is pressed */ .my-toggle[aria-pressed="true"] .nds-icon { --nds-icon: var(--nds-icon-view-off); }

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 only i.nds-icon, so a <span> shows nothing.
  • Copy a name exactly, with its number: hgi-arrow-left-01, not hgi-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, not width and height. 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.

Last Modified Date: 19/10/2026 - 07:42 AM
Was this page useful?
60% of users said Yes from 2843 Feedbacks