Skip to content

Getting Started

Terminal window
npm install -g relaxicons

Install your app framework if needed:

Terminal window
# React / Next.js
npm i react react-dom
npm i next # optional, for Next.js
# Vue
npm i vue
# Angular
npm i @angular/core
# Svelte
npm i svelte
# Solid
npm i solid-js
# Web Components
# no extra install required

Run the init command to create relaxicons.config.json.

Terminal window
relaxicons init

You’ll be prompted for:

  • Framework (auto-detected suggestions)
  • Output directory for generated components
  • TypeScript preference

Resulting minimal config:

{
"framework": "react",
"outDir": "src/components/icons",
"typescript": true
}
Terminal window
relaxicons add lucide:home

This will:

  1. Fetch raw SVG from Iconify.
  2. Transform attributes (remove width/height, set fill/stroke to currentColor).
  3. Generate a React component file (e.g. HomeIcon.tsx).
  4. Append export to barrel index.

List icons in a collection and narrow with a filter:

Terminal window
relaxicons icons lucide --filter home
relaxicons collections --filter luc

If you mistype an icon name, Relaxicons shows close suggestions.

Dive into the CLI Reference or explore the Icon Explorer.