DEV Community

Obiwan Pelosi
Obiwan Pelosi

Posted on

๐ŸŽ‰ Vue-icons (a react-icons equivalent) is finally here, LFG

If you've ever used React, you've probably come across the excellent react-icons library โ€” a single, tree-shakeable, well-typed icon package that just works.

But for Vue developers? The icon ecosystem has felt scattered and inconsistent... until now.

๐Ÿ‘‰ Say hello to Vue Icons Library โ€” a modern, TypeScript-first icon library designed specifically for Vue.

๐Ÿ”— Quick Links

  • ๐Ÿง‘โ€๐Ÿ’ป Visit the Website

  • ๐Ÿ“ฆ GitHub Repository

  • ๐Ÿš€ Install Now:

npm install vue-icons-lib

๐Ÿ” What is Vue Icons Library?

Vue Icons Library is the Vue 3 equivalent of react-icons โ€” a comprehensive, zero-dependency, tree-shakeable icon library that bundles 7+ popular icon sets into a single, intuitive API.

Built with modern Vue tooling, it brings performance, type safety, and simplicity to working with icons in your Vue apps.

๐ŸŽฏ Key Features

  • โœ… Tree-shakeable by design โ€“ Only the icons you import are included in your bundle

  • ๐Ÿ’ก TypeScript-first โ€“ Full type definitions with IDE IntelliSense

  • ๐Ÿงฉ Built for Vue 3 โ€“ Composition API, script setup support, and reactivity-ready

  • โšก Lightweight & Fast โ€“ Clean SVGs, optimized build pipeline

  • ๐Ÿงฑ Consistent API โ€“ Unified props (size, color, class, etc.) across all icons

  • โ™ฟ Accessible โ€“ Proper viewBox and accessible by default

  • ๐ŸŒ SSR Compatible โ€“ Works great with Nuxt, Vite SSR, etc.

๐ŸŽจ Included Icon Sets

Vue Icons Library ships with thousands of icons from your favorite sets:

  • Ant Design Icons
  • Box Icons
  • Circum Icons
  • CSS.gg Icons
  • Dev Icons
  • Feather Icons

More sets (like Material Icons and Heroicons) are coming soon!

โš™๏ธ Getting Started

Installation:

npm install vue-icons-lib

Basic usage:

<script setup>
import { FiHeart } from 'vue-icons-lib/fi';
import { AiFillStar } from 'vue-icons-lib/ai';
import { BxHome } from 'vue-icons-lib/bx';
</script>

<template>
  <div>
    <FiHeart color="#ff6b6b" size="24px" />
    <AiFillStar color="#ffd700" />
    <BxHome class="home-icon" />
  </div>
</template>
Enter fullscreen mode Exit fullscreen mode

Advanced Example:

<script setup>
import { FiHeart } from "vue-icons-lib/fi";

function handleClick() {
  console.log("Heart clicked!");
}
</script>

<template>
  <FiHeart
    size="32px"
    color="#ff6b6b"
    class="heart-icon"
    style="cursor: pointer; transition: transform 0.2s;"
    @click="handleClick"
  />
</template>
Enter fullscreen mode Exit fullscreen mode

๐Ÿš€ Real-World Usage Example:

<script setup>
import { FiHeart, FiStar, FiShare, FiBookmark } from "vue-icons-lib/fi";

const props = defineProps<{
  isLiked: boolean;
  isStarred: boolean;
}>();
</script>

<template>
  <div class="action-buttons">
    <FiHeart
      :color="isLiked ? '#ff6b6b' : '#666'"
      size="20px"
      class="action-icon"
      @click="$emit('toggle-like')"
    />
    <FiStar
      :color="isStarred ? '#ffd700' : '#666'"
      size="20px"
      class="action-icon"
      @click="$emit('toggle-star')"
    />
    <FiShare size="20px" class="action-icon" @click="$emit('share')" />
    <FiBookmark size="20px" class="action-icon" @click="$emit('bookmark')" />
  </div>
</template>

Enter fullscreen mode Exit fullscreen mode

๐Ÿ“ฆ Bundle Optimization

Before (bad):

<script setup>
import * as Icons from 'some-icon-library'; // ๐Ÿ˜ฑ All icons are bundled
</script>
Enter fullscreen mode Exit fullscreen mode

After (with Vue Icons Library):

<script setup>
import { FiHeart, FiStar } from 'vue-icons-lib/fi'; // โœ… Only what you need
</script>
Enter fullscreen mode Exit fullscreen mode

Result? โšก Smaller bundle size and faster load times โ€” especially important for production apps.

๐Ÿงช Compatibility & Support

โœ… Vue 2 & 3.x

โœ… Vite, Webpack, Rollup

โœ… TypeScript

โœ… SSR (Nuxt.js, etc.)

โœ… Tree-shaking compatible bundlers

โœ… All modern browsers

๐Ÿค Get Involved

Vue Icons Library is open source and welcomes contributions!

  • ๐Ÿ’ฌ Submit issues or feature requests

  • ๐Ÿ›  Add more icon sets or improve performance

  • ๐Ÿงพ Help refine the docs and examples

  • ๐ŸŒŸ Star the repo if you like the project!

GitHub โ†’ github.com/vue-icons-lib

๐Ÿ‘‰ Explore the icons and docs site here

Top comments (0)