Active theme set to LightDarkLight high contrastDark high contrast and saved in preferences.
Copied to clipboard.
Error submitting your feedback! Please try again.
We’re hiring frontend developers! View open positions.

IconReady

Icons are used to provide additional meaning or in places where text label doesn’t fit. Icon component allows you to display an icon from the Nordicons library.

Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
View RTL
<nord-icon size="xxl" name="navigation-dashboard"></nord-icon>

Properties

PropertyAttributeDescriptionTypeDefault
namename

The name of the icon to display, as defined by nordicons.

string""
sizesize

The size of the icon.

"xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl""m"
colorcolor

The color of the icon. Can accept any valid CSS color value, including custom properties.

string | undefinedundefined
labellabel

An accessible label for the icon. If no label is supplied, the icon is hidden from assistive technology.

string | undefinedundefined

Slots

Slot nameDescription
Default slotThe default slot used for placing a custom SVG icon.

Methods

Method nameParametersDescription
static registerResolver(resolver: IconResolver) => voidresolver: The resolver function to register.
Register a custom icon resolver, which accepts the icon name as an parameter, and returns an SVG string. Can return a string synchronously, or a promise of a string. By default, will load icons from the Nord CDN.
static registerIcon(icon: { title: string; default: string }) => voidicon: An object representing the icon to be registered, where "title" is the icon's name, and "default" is the SVG string. This is intended to be used in cases where you import an icon's entire ES module and register it directly.
Register an individual icon so it can be rendered synchronously, to avoid loading over the network.
static registerIcon(name: string, icon: string) => voidname: The name of the icon to be registered.
icon: The SVG string for the icon.
Register an individual icon so it can be rendered synchronously, to avoid loading over the network.
static registerIcon(iconOrName: string | { title: string; default: string }, icon?: string) => voidiconOrName: The name of the icon to be registered or an object representing the icon to be registered, where "title" is the icon's name, and "default" is the SVG string.
icon: The SVG string for the icon.
Register an individual icon so it can be rendered synchronously, to avoid loading over the network.

Usage #

This section includes guidelines for designers and developers about the usage of this component in different contexts.

View Nordicons

Do #

  • Use to provide additional meaning in addition to a text label.
  • Use to help users who have difficulties with reading and attention.
  • Use in places where text label doesn’t fit (remember to add an accessible label for the icon).

Don’t #

  • Don’t use for decorative purposes alone.
  • Don’t use when a button’s action is already clear based on the text label.
  • Don’t use the same icon for differing purposes, as users will come to associate icons with specific types of actions.

Additional considerations #

  • Icon components are hidden from assistive technologies by default.
  • Use label property to give an accessible label for the icon and to make it visible to assistive technologies.

Integration

For integration guidelines, please see Web Components documentation. This documentation explains how to implement and use Nord Web Components across different technologies such as Vue.js, React, or Vanilla JavaScript.

Integration Guidelines

Localization

Nord provides a lightweight solution for localizing its components. Not all components need localizing, as for the most part snippets of text are set per instance. For full localization guidelines, please see Localization documentation.

Localization Guidelines

Troubleshooting

If you experience any issues while using Nord Web Components, please head over to the Support page for more guidelines and ways to contact us.


Was this page helpful?

YesNo
Send feedback

We use this feedback to improve our documentation.