SVG icons

Svg Icons (via Iconify)

Edge has an official integration for rendering icons using Iconify. Iconify has over 100 open-source icon sets you can reference using a unified API.

Installation

The Edge and Iconify integration is a plugin you must install from the npm packages registry.

npm i edge-iconify

The next step is to register the plugin with Edge.

import { Edge } from 'edge.js'
import { edgeIconify } from 'edge-iconify'
const edge = Edge.create()
/**
* Register the plugin
*/
edge.use(edgeIconify)

Installing Iconify bundles

Before you can render icons, you will have to install the Iconify icon bundles. Iconify provides various distribution bundles. However, the Edge integration works only with JSON collections.

Let's install and use the HeroIcons icon set.

npm i @iconify-json/heroicons
import { Edge } from 'edge.js'
import { edgeIconify, addCollection } from 'edge-iconify'
import { icons as heroIcons } from '@iconify-json/heroicons'
/**
* Add heroIcons collection
*/
addCollection(heroIcons)
const edge = Edge.create()
/**
* Register the plugin
*/
edge.use(edgeIconify)

Usage

Once the setup is completed, you can render icons using the @svg tag. The svg tag accepts the icon identifier and an optional set of attributes to define on the output SVG element.

@svg('heroicons:arrow-left-solid')

Output

<svg width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M11.03 3.97a.75.75 0 0 1 0 1.06l-6.22 6.22H21a.75.75 0 0 1 0 1.5H4.81l6.22 6.22a.75.75 0 1 1-1.06 1.06l-7.5-7.5a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd"></path></svg>

In the following example, we define custom width, height, and color for the icon.

@svg('heroicons:arrow-left-solid', {
width: 40,
height: 40,
color: 'purple'
})

Output

<svg width="40" height="40" viewBox="0 0 24 24" color="purple"><path fill="currentColor" fill-rule="evenodd" d="M11.03 3.97a.75.75 0 0 1 0 1.06l-6.22 6.22H21a.75.75 0 0 1 0 1.5H4.81l6.22 6.22a.75.75 0 1 1-1.06 1.06l-7.5-7.5a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd"></path></svg>

Inline rendering within markup

You can use the svg global helper to render the SVG icons alongside the raw text markup (without a line break).

<button> {{ svg('heroicons:archive-box') }} Delete post <button>

Finding the icon identifier

You can view the available icons from the Iconify icons set browser.

  • Start by selecting the icon set you are using.
  • Search for the icon you want to use.
  • Click and copy its identifier displayed next to the Icon preview.

Finding and installing icon bundles

Unfortunately, we have not seen a detailed installation guide on the Iconify website for their JSON collections. You can use the following table to reference the collections and their npm package name.

The following table is aggregated from the Iconify collections.json file.

Icon set Npm package
Material Symbols @iconify-json/material-symbols
Material Symbols Light @iconify-json/material-symbols-light
Google Material Icons @iconify-json/ic
Material Design Icons @iconify-json/mdi
Material Design Light @iconify-json/mdi-light
Material Line Icons @iconify-json/line-md
Solar @iconify-json/solar
Tabler Icons @iconify-json/tabler
Huge Icons @iconify-json/hugeicons
MingCute Icon @iconify-json/mingcute
Remix Icon @iconify-json/ri
Myna UI Icons @iconify-json/mynaui
IconaMoon @iconify-json/iconamoon
Iconoir @iconify-json/iconoir
Lucide @iconify-json/lucide
Lucide Lab @iconify-json/lucide-lab
Unicons @iconify-json/uil
TDesign Icons @iconify-json/tdesign
Sargam Icons @iconify-json/si
BoxIcons @iconify-json/bx
BoxIcons Solid @iconify-json/bxs
Majesticons @iconify-json/majesticons
css.gg @iconify-json/gg
Flowbite Icons @iconify-json/flowbite
Basil @iconify-json/basil
Pixelarticons @iconify-json/pixelarticons
Akar Icons @iconify-json/akar-icons
coolicons @iconify-json/ci
ProIcons @iconify-json/proicons
Typicons @iconify-json/typcn
Meteor Icons @iconify-json/meteor-icons
Prime Icons @iconify-json/prime
Circum Icons @iconify-json/circum
Feather Icon @iconify-json/fe
EOS Icons @iconify-json/eos-icons
Bitcoin Icons @iconify-json/bitcoin-icons
Humbleicons @iconify-json/humbleicons
Unicons Monochrome @iconify-json/uim
Unicons Thin Line @iconify-json/uit
Unicons Solid @iconify-json/uis
Gridicons @iconify-json/gridicons
Mono Icons @iconify-json/mi
Cuida Icons @iconify-json/cuida
WeUI Icon @iconify-json/weui
Duoicons @iconify-json/duo-icons
SVG Spinners @iconify-json/svg-spinners
Lets Icons @iconify-json/lets-icons
Mage Icons @iconify-json/mage
Stash Icons @iconify-json/stash
Lineicons @iconify-json/lineicons
IconPark Outline @iconify-json/icon-park-outline
IconPark Solid @iconify-json/icon-park-solid
IconPark TwoTone @iconify-json/icon-park-twotone
Jam Icons @iconify-json/jam
Guidance @iconify-json/guidance
Carbon @iconify-json/carbon
IonIcons @iconify-json/ion
Famicons @iconify-json/famicons
Ant Design Icons @iconify-json/ant-design
Lsicon @iconify-json/lsicon
Gravity UI Icons @iconify-json/gravity-ui
CoreUI Free @iconify-json/cil
Element Plus @iconify-json/ep
Charm Icons @iconify-json/charm
Quill Icons @iconify-json/quill
Bytesize Icons @iconify-json/bytesize
Bootstrap Icons @iconify-json/bi
Rivet Icons @iconify-json/rivet-icons
Nimbus @iconify-json/nimbus
FormKit Icons @iconify-json/formkit
Fluent UI System Icons @iconify-json/fluent
Phosphor @iconify-json/ph
Teenyicons @iconify-json/teenyicons
Clarity @iconify-json/clarity
Siemens Industrial Experience Icons @iconify-json/ix
Octicons @iconify-json/octicon
Memory Icons @iconify-json/memory
System UIcons @iconify-json/system-uicons
Radix Icons @iconify-json/radix-icons
Zondicons @iconify-json/zondicons
uiw icons @iconify-json/uiw
Maki @iconify-json/maki
CodeX Icons @iconify-json/codex
Evil Icons @iconify-json/ei
HeroIcons @iconify-json/heroicons
Pepicons Pop! @iconify-json/pepicons-pop
Pepicons Print @iconify-json/pepicons-print
Pepicons Pencil @iconify-json/pepicons-pencil
Framework7 Icons @iconify-json/f7
Gitlab SVGs @iconify-json/pajamas
Garden SVG Icons @iconify-json/garden
Streamline @iconify-json/streamline
Font Awesome Solid @iconify-json/fa6-solid
Font Awesome Regular @iconify-json/fa6-regular
OOUI @iconify-json/ooui
OpenSearch UI @iconify-json/oui
NRK Core Icons @iconify-json/nrk
Qlementine Icons @iconify-json/qlementine-icons
Fluent UI System Color Icons @iconify-json/fluent-color
IconPark @iconify-json/icon-park
Marketeq @iconify-json/marketeq
VSCode Icons @iconify-json/vscode-icons
Codicons @iconify-json/codicon
File Icons @iconify-json/file-icons
Devicon @iconify-json/devicon
Devicon Plain @iconify-json/devicon-plain
Catppuccin Icons @iconify-json/catppuccin
Skill Icons @iconify-json/skill-icons
UnJS Logos @iconify-json/unjs
Simple Icons @iconify-json/simple-icons
SVG Logos @iconify-json/logos
CoreUI Brands @iconify-json/cib
Font Awesome Brands @iconify-json/fa6-brands
BoxIcons Logo @iconify-json/bxl
Nonicons @iconify-json/nonicons
Arcticons @iconify-json/arcticons
Custom Brand Icons @iconify-json/cbi
Brandico @iconify-json/brandico
Entypo+ Social @iconify-json/entypo-social
Web3 Icons @iconify-json/token
Web3 Icons Branded @iconify-json/token-branded
Cryptocurrency Icons @iconify-json/cryptocurrency
Cryptocurrency Color Icons @iconify-json/cryptocurrency-color
OpenMoji @iconify-json/openmoji
Twitter Emoji @iconify-json/twemoji
Noto Emoji @iconify-json/noto
Fluent Emoji @iconify-json/fluent-emoji
Fluent Emoji Flat @iconify-json/fluent-emoji-flat
Fluent Emoji High Contrast @iconify-json/fluent-emoji-high-contrast
Noto Emoji (v1) @iconify-json/noto-v1
Emoji One (Colored) @iconify-json/emojione
Emoji One (Monotone) @iconify-json/emojione-monotone
Emoji One (v1) @iconify-json/emojione-v1
Firefox OS Emoji @iconify-json/fxemoji
Streamline Emojis @iconify-json/streamline-emojis
Circle Flags @iconify-json/circle-flags
Flag Icons @iconify-json/flag
Flagpack @iconify-json/flagpack
CoreUI Flags @iconify-json/cif
Font-GIS @iconify-json/gis
Map Icons @iconify-json/map
GeoGlyphs @iconify-json/geo
Game Icons @iconify-json/game-icons
FontAudio @iconify-json/fad
Academicons @iconify-json/academicons
Weather Icons @iconify-json/wi
Meteocons @iconify-json/meteocons
Health Icons @iconify-json/healthicons
Medical Icons @iconify-json/medical-icon
Covid Icons @iconify-json/covid
Line Awesome @iconify-json/la
Eva Icons @iconify-json/eva
Dashicons @iconify-json/dashicons
Flat Color Icons @iconify-json/flat-color-icons
Entypo+ @iconify-json/entypo
Foundation @iconify-json/foundation
Raphael @iconify-json/raphael
Icons8 Windows 10 Icons @iconify-json/icons8
Innowatio Font @iconify-json/iwwa
Gala Icons @iconify-json/gala
HeroIcons v1 Outline @iconify-json/heroicons-outline
HeroIcons v1 Solid @iconify-json/heroicons-solid
Font Awesome 5 Solid @iconify-json/fa-solid
Font Awesome 5 Regular @iconify-json/fa-regular
Font Awesome 5 Brands @iconify-json/fa-brands
Font Awesome 4 @iconify-json/fa
Fluent UI MDL2 @iconify-json/fluent-mdl2
Fontisto @iconify-json/fontisto
IcoMoon Free @iconify-json/icomoon-free
Subway Icon Set @iconify-json/subway
Open Iconic @iconify-json/oi
Icons8 Windows 8 Icons @iconify-json/wpf
Simple line icons @iconify-json/simple-line-icons
Elegant @iconify-json/et
Elusive Icons @iconify-json/el
Vaadin Icons @iconify-json/vaadin
Grommet Icons @iconify-json/grommet-icons
WebHostingHub Glyphs @iconify-json/whh
SmartIcons Glyph @iconify-json/si-glyph
Material Design Iconic Font @iconify-json/zmdi
Ligature Symbols @iconify-json/ls
BPMN @iconify-json/bpmn
Flat UI Icons @iconify-json/flat-ui
Vesper Icons @iconify-json/vs
TopCoat Icons @iconify-json/topcoat
Icalicons @iconify-json/il
Web Symbols Liga @iconify-json/websymbol
Fontelico @iconify-json/fontelico
PrestaShop Icons @iconify-json/ps
Feather Icons @iconify-json/feather
Mono Icons @iconify-json/mono-icons
Pepicons @iconify-json/pepicons