HugeIcons Pro Svelte Component Library - Beautiful and customizable icons for your Svelte applications
HugeIcons is a comprehensive icon library designed for modern web and mobile applications. The free package includes 4,000+ carefully crafted icons in the Stroke Rounded style, while the pro version offers over 36,000 icons across 9 unique styles.
📚 Looking for Pro Icons? Check out our comprehensive documentation at docs.hugeicons.com for detailed information about pro icons, styles, and advanced usage.
# Using npm
npm install @hugeicons/svelte @hugeicons/core-free-icons
# Using yarn
yarn add @hugeicons/svelte @hugeicons/core-free-icons
# Using pnpm
pnpm add @hugeicons/svelte @hugeicons/core-free-icons
# Using bun
bun add @hugeicons/svelte @hugeicons/core-free-icons
<script>
import { HugeiconsIcon } from '@hugeicons/svelte';
import { SearchIcon } from '@hugeicons/core-free-icons';
</script>
<HugeiconsIcon
icon={SearchIcon}
size={24}
color="currentColor"
strokeWidth={1.5}
/>
Prop | Type | Default | Description |
---|---|---|---|
icon |
IconType |
Required | The main icon to display |
altIcon |
IconType |
- | Alternative icon that can be used for states, interactions, animations, or dynamic icon swapping |
showAlt |
boolean |
false |
When true, displays the altIcon instead of the main icon |
size |
number |
24 |
Icon size in pixels |
color |
string |
currentColor |
Icon color (CSS color value) |
strokeWidth |
number |
1.5 |
Width of the icon strokes (works with stroke-style icons) |
absoluteStrokeWidth |
boolean |
false |
When true, strokeWidth will be absolute and won't scale with the icon size |
class |
string |
- | Additional CSS classes |
<script>
import { HugeiconsIcon } from '@hugeicons/svelte';
import { SearchIcon } from '@hugeicons/core-free-icons';
</script>
<HugeiconsIcon icon={SearchIcon} />
<script>
import { HugeiconsIcon } from '@hugeicons/svelte';
import { NotificationIcon } from '@hugeicons/core-free-icons';
</script>
<HugeiconsIcon
icon={NotificationIcon}
size={32}
color="#FF5733"
/>
<script>
import { HugeiconsIcon } from '@hugeicons/svelte';
import { SearchIcon, CloseCircleIcon } from '@hugeicons/core-free-icons';
let value = '';
</script>
<div>
<input
type="text"
bind:value
placeholder="Search..."
/>
<HugeiconsIcon
icon={SearchIcon}
altIcon={CloseCircleIcon}
showAlt={value.length > 0}
on:click={() => value.length > 0 && (value = '')}
/>
</div>
<script>
import { HugeiconsIcon } from '@hugeicons/svelte';
import { SunIcon, MoonIcon } from '@hugeicons/core-free-icons';
let isDark = false;
</script>
<button on:click={() => isDark = !isDark}>
<HugeiconsIcon
icon={SunIcon}
altIcon={MoonIcon}
showAlt={isDark}
/>
</button>
<script>
import { HugeiconsIcon } from '@hugeicons/svelte';
import { MenuIcon, CancelIcon } from '@hugeicons/core-free-icons';
let isOpen = false;
</script>
<button on:click={() => isOpen = !isOpen}>
<HugeiconsIcon
icon={MenuIcon}
altIcon={CancelIcon}
showAlt={isOpen}
/>
</button>
Icons not showing up?
@hugeicons/svelte
and @hugeicons/core-free-icons
TypeScript errors?
tsconfig.json
includes the necessary type definitionsBundle size concerns?
The library supports all modern browsers.
🌟 Want access to 36,000+ icons and 9 unique styles? Check out our Pro Version and visit docs.hugeicons.com for comprehensive documentation.
@hugeicons-pro/core-stroke-rounded
)@hugeicons-pro/core-stroke-sharp
)@hugeicons-pro/core-stroke-standard
)@hugeicons-pro/core-solid-rounded
)@hugeicons-pro/core-solid-sharp
)@hugeicons-pro/core-solid-standard
)@hugeicons-pro/core-bulk-rounded
)@hugeicons-pro/core-duotone-rounded
)@hugeicons-pro/core-twotone-rounded
)This project is licensed under the MIT License.