InkiconMake your set

Guides

How to add an SVG icon set to your project

There are four common ways to put SVG icons on a page. They differ in whether the icon can take your text colour, how many requests they make, and how they work with frameworks.

MethodTakes text colourBest for
Inline SVGYesA few icons, full control
<img>NoStatic, single-colour pages
Sprite + <use>YesMany icons on plain HTML sites
ComponentsYesReact and similar frameworks

1. Inline SVG

Paste the file's contents straight into your HTML. Shapes drawn in currentColor take the surrounding text colour.

<button aria-label="Search">
  <svg viewBox="0 0 24 24" width="24" height="24" fill="currentColor" aria-hidden="true">…</svg>
</button>

2. An image tag

<img src="icons/search.svg" alt="Search" width="24" height="24">

Simple and cacheable, but an image can't see your CSS, so currentColor draws black. Avoid it for dark mode or coloured buttons.

3. A sprite with <use>

<svg width="24" height="24" aria-hidden="true"><use href="sprite.svg#icon-search"/></svg>

One file holds every icon, and each use takes your text colour. The sprite must come from the same site as the page; browsers block cross-origin <use> and files opened from disk.

4. Components

import { SearchIcon } from './icons/react/icons.js';
<SearchIcon size={20} />

The most convenient option in a framework: sizes, colours and labels become props. See SVG icons for React.

Accessibility, whichever you choose

Every Inkicon pack follows these rules and includes all four formats, with a README showing each.

Make your icon set →