Getting started with Clarity Icons

The Clarity Icons library presents pixel-perfect, scalable SVG-based icons. This new icon system gives you complete control over icon color, orientation, and size. Additionally, you can access and customize any SVG graphic elements inside the icon through standard CSS.

Install and load Clarity Icons:

Install the Clarity Icons package through npm:

Install the polyfill for Custom Elements, on which Clarity Icons is dependent:

Load the library in your app by including clr-icons.min.css and clr-icons.min.js. Also, make sure to include custom-elements.min.js, the Custom Elements polyfill before clr-icons.min.js: That's it! As clr-icons.min.js loads not only the Clarity Icons Api, but also all icons sets, you will have access to more than 100 different icons that have variants, orientations, and colors out of the box. You can now render any icon with clr-icon tag and specify your desired shape in its shape attribute.

View example

Load icon sets individually:

If you want to use icons from few individual sets, you don't have to load all icons with clr-icons.min.js. Instead, load the lighter version of Clarity Icons library with clr-icons-lite.min.js, which loads only Clarity Icons Api and Core Shapes set. For example, if you want to use icons from only Social Shapes and Travel Shapes, you would load Clarity Icons this way:

View example

Load Clarity Icons API and icon sets in Typescript:

It's easy to load Clarity Icons API and icon sets in Typescript.

If you load the Clarity Icons in Typescript, make sure you are not loading it through the script tag again. Otherwise you will have two different instances of Clarity Icons that override one another.

For example: The example above is loading only Clarity Icons Api and Core Shapes set. You can load more icon sets on top of it as needed: And lastly, if you need to use shapes from all sets, you don't need to import and load every single icon set, because you have a shortcut for loading all sets:

View example