Skip to content

Icon Collection Introduction

A high-performance icon library based on Iconify, supporting 100+ icon sets with on-demand loading and zero runtime overhead.

Features

  • 🚀 High Performance - Uses unplugin-icons for build-time on-demand loading.
  • 📦 Compact Size - Maximized Tree-shaking; only the icons you use are bundled.
  • 🎨 100+ Icon Sets - Integrates with the Iconify ecosystem, offering over 200,000 icons.
  • 🔧 Full Compatibility - Maintains compatibility with the existing YhIcon component API.
  • 🌳 SSR Support - Supports Server-Side Rendering.

Basic Usage

Specify an icon using the icon property in the format prefix:icon-name.

Basic Usage

Different Sizes

Use the size property to set the icon dimension, supporting both numbers and strings.

Different Sizes

Custom Colors

Use the color property to set the icon color.

Custom Colors

Spin Animation

Use the spin property to rotate the icon, which is commonly used for loading states.

Spin Animation

Rotation Angle

Use the rotate property to set a static rotation angle for the icon.

Rotation Angle

Why Iconify?

Issues with Traditional Methods

MethodDisadvantage
Icon FontRequires extra font file requests, SSR-unfriendly, difficult to control colors.
SVG FilesEach icon is a separate file, making management difficult.
Built-in Component IconsLimited number of icons, difficult to extend.

Advantages of Iconify

  • On-demand Loading: Bundles only the icons you use, minimizing bundle size.
  • Unified API: Different icon sets use the same interface.
  • Massive Selection: Over 200,000 icons available.
  • Tree-shaking: Automatically removes unused icons.

Usage

Installation

bash
npm install @yh-ui/icons

Usage in Vue

vue
<script setup lang="ts">
import { Icon } from '@yh-ui/icons'
</script>

<template>
  <Icon icon="mdi:home" />
  <Icon icon="ep:search" />
  <Icon icon="mdi:loading" spin />
</template>

Common icon set prefixes:

PrefixIcon SetIcon Count
mdiMaterial Design Icons6000+
epElement Plus200+
lucideLucide1500+
tablerTabler Icons3000+
riRemix Icon2000+
biBootstrap Icons1500+
fxemojiFirefox Emoji1000+

For more icon sets, please visit the Iconify Icon Library.

Released under the MIT License.