Svelte Package Installation
To get started with the HugeIcons Svelte package, you need to install it from npm or yarn.
Installation
Follow the steps below to install the HugeIcons package and start using the icons in your Svelte project.
1. Create an Account:
Visit our website hugeicons.com (opens in a new tab) and create an account or log in if you already have one.
2. Activate Your License:
Go to the Subscription tab and activate your license.
3. Get Your NPM Token:
Navigate to the Tokens tab and copy your unique npm token.
4. Install the New Private Package:
Create a new .npmrc
file in your project root directory.
5. Add the following lines to your .npmrc file:
//registry.npmjs.org/:_authToken=YOUR_NPM_TOKEN
For Bun users:
Here is an example to setup private repo in bun for new packages you need to add this to your bunfig.toml file
[install.scopes]
@hugeicons = { token = "YOUR_NPM_TOKEN", url = "https://registry.npmjs.org/" }
Replace YOUR_NPM_TOKEN with the token you copied from the Tokens tab.
After that you need to install the @hugeicons/svelte
package:
npm i @hugeicons/svelte
Example
Here's a quick example of how to use an icon in a Svelte project:
<script>
import {Home01Icon} from '@hugeicons/svelte';
</script>
<div>
<Home01Icon
variant={"stroke"}
style={"rounded"}
size={48}
color={"#b60fa8"}
/>
</div>