Iconweuse provides a native, tree-shakeable integration with Vue 3. All components are shipped with full TypeScript definition files and auto-completion support.
Install the main package using your package manager of choice:
npm install iconweuseImport individual icons as components within your Single File Components (SFCs). This approach is highly recommended for production since it allows bundlers like Vite or Webpack to automatically tree-shake unused icons.
<script setup>
import { SearchIcon, UserIcon, SettingsIcon } from 'iconweuse/vue';
</script>
<template>
<div class="flex gap-4">
<SearchIcon :size="24" color="#FE663A" />
<UserIcon :size="24" />
<SettingsIcon class="animate-spin" />
</div>
</template>Our Vue components accept standard SVG props to customize their dimensions, style, and responsiveness:
If you prefer to make specific icons available globally throughout your application, register them inside your main entry file:
import { createApp } from 'vue';
import App from './App.vue';
import { SearchIcon, HomeIcon } from 'iconweuse/vue';
const app = createApp(App);
app.component('SearchIcon', SearchIcon);
app.component('HomeIcon', HomeIcon);
app.mount('#app');