Skip to content

Getting Started

Astro Iconset adds an Icon component and an Astro integration for local SVGs and Iconify sets. This guide assumes you already have an Astro project. If not, see the Astro installation guide.

astro add is not required. Pick your package manager:

Terminal window
npm install astro-iconset

Add the integration to astro.config.mjs:

astro.config.mjs
import { defineConfig } from "astro/config";
import icon from "astro-iconset";
export default defineConfig({
integrations: [icon()],
});

Place .svg files under src/icons/ (the default). You may use subfolders — for example src/icons/logos/astro.svg is referenced as logos/astro.

---
import { Icon } from "astro-iconset/components";
---
<Icon name="my-icon" />

If something does not work as expected, open an issue with a minimal reproduction.

Third-party integrations are not handled by @astrojs/upgrade. Install the latest tag manually:

Terminal window
npm install astro-iconset@latest

See the changelog for release notes.

Use the configuration reference and the guides in the sidebar. If the problem is Astro itself, the Astro documentation is the best place to start. For bugs and feature requests, use GitHub issues.