React Package Installation
To get started with the HugeIcons React 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 React 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/react
package:
npm i @hugeicons/react
Example
Here's a quick example of how to use an icon in a React component:
import React from 'react';
import { Home01Icon } from '@hugeicons/react';
function App() {
return (
<div>
<Home01Icon />
</div>
);
}
export default App;