index


目录

title: Icons on Demand
replacements:
  - code: '60,000'
    value: '${counters.icons}'
  - code: '60k'
    value: '${counters.icons-short}'

Icons on demand

Iconify ecosystem has a unique feature: Iconify API.

It can be used to load icon data on demand and is used by Iconify icon components.

Skip to list of available components if you want to skip long explanation of how it all works.

How does it work? {#process}

Iconify icon components are very easy to use. All developer has to specify is an icon name:

src: icon-components/icon/usage.html
demo: true
demoFirst: false
class: sample-big

Unlike regular icon components, Iconify icon components do not bundle icon data. They load only data for icons used on currently viewed page at run time.

Advantages

Loading icon data on demand has its advantages and disadvantages over using regular icon components.

Advantages:

Disadvantages:

Components

The best option by far is Web component. It is usable in HTML with or without UI frameworks.

Additionally, there are components for UI frameworks: React, Vue, Svelte, Ember.

In future, only [npm]iconify-icon web component will be supported. Why?

Web component {#web-component}

The best option by far is web component. It is the most modern iteration, works with all UI frameworks and works great with server side rendering.

Usage is simple:

<iconify-icon icon="mdi:home"></iconify-icon>

See Iconify icon web component documentation.

Shadow DOM

Web component renders icon in Shadow DOM, separating it from the main document.

That has its advantages and disadvantages over other components.

Advantages:

Disadvantages:

If these disadvantages are unacceptable for your project, use "SVG framework" or one of UI framework specific components listed below.

UI frameworks {#ui-frameworks}

Iconify offers components native to various UI frameworks:

Usage is as any other component:

<Icon icon="mdi:home" />

These components behave differently than the web component:

You should consider using the [npm]iconify-icon web component instead of components mentioned above. Dynamic data loading does not work well with SSR. Web component solves those issues.

Legacy components

In addition to components listed above, there are several legacy components. They were created a long time ago, but no longer relevant in modern development.

These components are no longer updated, but can be used if you really need it:


版本号 #2
由 壳壳虫 创建于 2026-10-31 14:18:22 UTC
由 壳壳虫 更新于 2026-10-31 14:18:23 UTC