Integrations
Vue

Vue

The @hugeicons/vue package is freely available on the public npm registry. To use HugeIcons in your Vue project, you'll need to install both the Vue component package and at least one icon package of your choice. This modular approach allows you to keep your bundle size minimal by including only the icons you plan to use.

Installation

  1. Install the Vue component package:
npm install @hugeicons/vue
  1. Install your preferred icon package(s):
npm install @hugeicons-pro/core-{variant}-{style}

Available styles:

HugeIcons Pro offers 36,000+ icons across 9 unique styles:

# Stroke Styles (Line icons with different corner styles)
@hugeicons-pro/core-stroke-rounded
@hugeicons-pro/core-stroke-sharp
@hugeicons-pro/core-stroke-standard
 
# Solid Styles (Filled icons with different corner styles)
@hugeicons-pro/core-solid-rounded
@hugeicons-pro/core-solid-sharp
@hugeicons-pro/core-solid-standard
 
# Special Styles (Unique visual treatments)
@hugeicons-pro/core-bulk-rounded      # Chunky style with depth
@hugeicons-pro/core-duotone-rounded   # Two-color design with primary/secondary emphasis
@hugeicons-pro/core-twotone-rounded   # Alternative two-color treatment

For more detailed information about our core packages and available styles, please visit our Core Packages page.

Basic Usage

<script setup>
import { HugeiconsIcon } from '@hugeicons/vue'
import { Notification03Icon } from '@hugeicons-pro/core-stroke-rounded'
</script>
 
<template>
  <HugeiconsIcon
    :icon="Notification03Icon"
    :size="24"
    color="currentColor"
    :strokeWidth="1.5"
  />
</template>

Props

PropTypeDefaultDescription
iconIconSvgObjectRequiredThe main icon component imported from an icon package
altIconIconSvgObject-Alternative icon component from an icon package for states, interactions, or animations
showAltbooleanfalseWhen true, displays the altIcon instead of the main icon
sizenumber24Icon size in pixels
colorstringcurrentColorIcon color (CSS color value)
strokeWidthnumber1.5Width of the icon strokes (works with stroke-style icons)
classstring-Additional CSS classes

Icon Naming

Each icon in our packages can be imported using either its main name or its style-specific alias:

// Both imports refer to the same icon
import { SearchIcon } from '@hugeicons-pro/core-stroke-rounded'
import { SearchStrokeRounded } from '@hugeicons-pro/core-stroke-rounded'

We recommend using the shorter main name (e.g., SearchIcon) for better readability. The style-specific aliases are useful when importing the same icon from different style packages to avoid naming conflicts.

Examples of Dynamic Icon Interactions

Search Bar with Clear Button

A search input that shows a clear button when text is entered:

<script setup>
import { ref } from 'vue'
import { HugeiconsIcon } from '@hugeicons/vue'
import { SearchIcon, CloseCircleIcon } from '@hugeicons-pro/core-stroke-rounded'
 
const searchValue = ref('')
</script>
 
<template>
  <div>
    <input
      v-model="searchValue"
      type="text"
      placeholder="Search..."
    />
    <HugeiconsIcon
      :icon="SearchIcon"
      :altIcon="CloseCircleIcon"
      :showAlt="searchValue.length > 0"
      @click="searchValue.length > 0 ? searchValue = '' : null"
    />
  </div>
</template>

Theme Toggle with Style Switch

A simple dark mode toggle using different icons:

<script setup>
import { ref } from 'vue'
import { HugeiconsIcon } from '@hugeicons/vue'
import { SunIcon, Moon02Icon } from '@hugeicons-pro/core-solid-rounded'
 
const isDark = ref(false)
</script>
 
<template>
  <button @click="isDark = !isDark">
    <HugeiconsIcon
      :icon="SunIcon"
      :altIcon="Moon02Icon"
      :showAlt="isDark"
    />
  </button>
</template>

Navigation Bar with Style Switch

A navigation bar that uses different icon styles to indicate the active state:

<script setup>
import { ref } from 'vue'
import { HugeiconsIcon } from '@hugeicons/vue'
import { 
  HomeIcon,
  SearchIcon,
  Notification03Icon,
  UserIcon 
} from '@hugeicons-pro/core-solid-rounded'
import {
  HomeIcon as HomeDuotone,
  SearchIcon as SearchDuotone,
  Notification03Icon as NotificationDuotone,
  UserIcon as UserDuotone
} from '@hugeicons-pro/core-duotone-rounded'
 
const activeTab = ref('home')
 
const NavItem = defineComponent({
  props: {
    id: String,
    solidIcon: Object,
    duotoneIcon: Object
  },
  setup(props) {
    return () => (
      <button
        onClick={() => activeTab.value = props.id}
        class={`nav-item ${activeTab.value === props.id ? 'active' : ''}`}
      >
        <HugeiconsIcon
          :icon="props.solidIcon"
          :altIcon="props.duotoneIcon"
          :showAlt="activeTab.value === props.id"
          :size="24"
        />
      </button>
    )
  }
})
</script>
 
<template>
  <nav>
    <NavItem id="home" :solidIcon="HomeIcon" :duotoneIcon="HomeDuotone" />
    <NavItem id="search" :solidIcon="SearchIcon" :duotoneIcon="SearchDuotone" />
    <NavItem id="notifications" :solidIcon="Notification03Icon" :duotoneIcon="NotificationDuotone" />
    <NavItem id="profile" :solidIcon="UserIcon" :duotoneIcon="UserDuotone" />
  </nav>
</template>