Hugeicons Svelte rendering library for fast, customizable icons with TypeScript and tree-shaking support
Hugeicons is a large icon set for modern web and mobile apps. The free package includes 4,600+ Stroke Rounded icons. The Pro package provides 46,000+ icons across 10 styles.
This package (@hugeicons/svelte) is a rendering library - it provides the HugeiconsIcon component that displays icons in your Svelte app. The icons themselves come from separate icon packages:
@hugeicons/core-free-icons (4,600+ icons)@hugeicons-pro/core-* packages (46,000+ icons, requires license)Looking for Pro Icons? Check out our docs at hugeicons.com/docs 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 |
IconSvgElement |
Required | The main icon to display |
altIcon |
IconSvgElement |
- | Alternative icon for states, interactions, or dynamic icon swapping |
showAlt |
boolean |
false |
When true, displays the altIcon instead of the main icon |
size |
number | string |
24 |
Icon size in pixels |
color |
string |
currentColor |
Icon color (CSS color value) |
strokeWidth |
number |
- | Width of the icon strokes |
absoluteStrokeWidth |
boolean |
false |
When true, the stroke width will be scaled relative to the icon size |
className |
string |
- | Additional CSS classes |
<script>
import { HugeiconsIcon } from '@hugeicons/svelte';
import { Video01Icon } from '@hugeicons/core-free-icons';
</script>
<HugeiconsIcon icon={Video01Icon} />
<script>
import { HugeiconsIcon } from '@hugeicons/svelte';
import { NotificationIcon } from '@hugeicons/core-free-icons';
</script>
<HugeiconsIcon
icon={NotificationIcon}
size={32}
color="#FF5733"
/>
Icons not showing up?
@hugeicons/svelte and @hugeicons/core-free-iconsTypeScript errors?
tsconfig.json includes the necessary type definitionsBundle size concerns?
The library supports all modern browsers.
Want access to 46,000+ icons and 10 unique styles? Check out our Pro Version and visit our docs for detailed 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-duotone-standard)@hugeicons-pro/core-twotone-rounded)The code in this package (@hugeicons/svelte) is licensed under the MIT License.
This package only provides rendering utilities. It does not include or grant any rights to Hugeicons icon assets. Using Pro icon styles requires a valid Hugeicons Pro license.
Hugeicons icon packs are licensed separately:
@hugeicons-pro/*): require a paid Hugeicons Pro license and are governed by the Hugeicons Pro Terms (see Pro License.).