Chameleon Icons
/
CommunityTopHow it worksTrace a picture

Icons in your code

Every icon in every style, in React, Vue, Svelte, Solid, Preact, Astro, Angular or plain HTML. Open any icon, pick Use in code, copy the line. Only the icons you use are fetched, once, and each stays the exact drawing you picked.

Finding icons

Browse the site, or ask from the command line: every public style, then the icons one has drawn (by name, title or tag: home finds cute/house).

npx chameleonicons styles
npx chameleonicons icons cute
npx chameleonicons icons cute home

1. Import straight from the site

Install the package and add its plugin once:

npm i -D chameleonicons

Vite (React, Vue, Svelte, Solid, Preact, SvelteKit, Remix, Nuxt...):

// vite.config.js
import chameleon from "chameleonicons/vite";

export default {
  plugins: [chameleon()],
};

Next.js, with Turbopack (the default since Next 16) or next build --webpack:

// next.config.mjs
import withChameleon from "chameleonicons/next";

export default withChameleon({});

Astro:

// astro.config.mjs
import chameleon from "chameleonicons/astro";

export default {
  integrations: [chameleon()],
};

webpack, Rollup, esbuild and Rspack: chameleonicons/webpack, /rollup, /esbuild, /rspack, the same way.

Then import any icon as ~chameleon/<style>/<icon>:

import Umbrella from "~chameleon/bauhaus/umbrella";
import Airport from "~chameleon/maki/airport";

<Umbrella />
<Airport width={32} height={32} aria-label="Airport" />
  • An icon is 1em by 1em: it follows the font size, like text. Give it width, height, a class or any attribute.
  • The plugin finds your framework in package.json. Say it yourself with chameleon({ framework: "vue" }), or per import: ~chameleon/bauhaus/umbrella?svelte.
  • Every icon also hands over the SVG as text and as a data URL: import Umbrella, { raw, url } from "~chameleon/bauhaus/umbrella";. ?raw and ?url on the import do the same, with Turbopack too.
  • TypeScript: add "types": ["chameleonicons/react"] (or /vue, /svelte, /solid, /preact) to compilerOptions in tsconfig.json.
  • Pinned: the first build writes each icon's version into chameleon.json, so it stays that drawing even if people vote another one in. Commit it. npx chameleonicons update moves the pins to what the styles show now; npx chameleonicons sync fetches every icon your code imports ahead of time (CI, offline).

Angular

Angular's build takes no plugins, so it uses the <chameleon-icon> element. Once, in main.ts:

// npm i chameleonicons
import "chameleonicons/element";

Add CUSTOM_ELEMENTS_SCHEMA to your component's schemas and use any icon:

<chameleon-icon icon="bauhaus/umbrella"></chameleon-icon>
<chameleon-icon icon="maki/airport" size="32" label="Airport"></chameleon-icon>

While you work, icons load from the site. Before you ship, build them in: sync finds every icon your templates use, pins it and writes them into src/chameleon-icons.ts. Import that once too, and nothing is fetched.

npx chameleonicons sync

// main.ts
import "./chameleon-icons";

Or make each icon a component of its own (<ci-bauhaus-umbrella />) with npx chameleonicons add bauhaus/umbrella --framework angular.

2. Copy them into your project

No plugin: the icons become files in your project (src/icons/<style>/), for every framework, Angular too.

npx chameleonicons add bauhaus/umbrella maki/airport
import { Umbrella } from "./icons/bauhaus";

Options: --framework react|preact|solid|vue|svelte|astro|angular|raw, --out src/icons, --ts, --js. They are kept in chameleon.json.

3. Plain HTML, no build

<script type="module" src="https://chameleonicons.com/element.js"></script>

<chameleon-icon icon="bauhaus/umbrella"></chameleon-icon>
<chameleon-icon icon="maki/airport" size="32" label="Airport"></chameleon-icon>

Or just the picture:

<img src="https://chameleonicons.com/i/bauhaus/umbrella.svg" width="24" height="24" alt="Umbrella">

Colours and versions

  • One-colour styles draw in currentColor: the icon takes the text colour.
  • style/name@4211 is one exact version: Use in code adds it when you look at a version the style does not show.
  • Every component says in a comment where it comes from and what made it. Drawings made with AI are marked as such, in code only, never on the icon.

Styles with a palette keep their colours, and every coloured shape says which palette colour it is: class="ei-c1" is the first, ei-c2 the second and so on (ei-cw is white kept white; an icon has only the colours it uses). Recolour with CSS, which wins over the drawing's own fill, or give the picture its colours in palette order:

.cat .ei-c1 { fill: #222; }
.cat .ei-c2 { fill: hotpink; }

<img src="https://chameleonicons.com/i/cute/cat.svg?colors=222222,ff69b4">

4. Generate and upload missing icons from your terminal

Need an icon a style has not drawn yet, or want to use leftover image generations from your Codex (ChatGPT), Antigravity (Google AI) or Grok Build plan? Sign the CLI in once (opens your browser to approve, or paste a key from Account → CLI & Agents):

npx chameleonicons login
npx chameleonicons packs
npx chameleonicons next bauhaus/umbrella

That reserves the icon and saves its prompt and style reference sheet locally. Generate the image with your own AI tool, then upload it to be traced, scored and added in your name:

npx chameleonicons upload <task> drawing.png --via codex
# Or ask your AI coding agent to run the whole loop:
npx chameleonicons agent

Licences

The package is MIT. The icons keep their own: a drawing from an open source icon set is under that set's licence, named in the component's comment (CC BY asks you to credit its author). For the community's drawings, see the terms.

The API

The package uses three public endpoints, free to use from your own tools. The icons themselves (200 a request):

GET https://chameleonicons.com/api/v1/icons?i=bauhaus/umbrella,maki/airport@4211

It answers { icons: { "bauhaus/umbrella": { v, style, styleName, name, title, attrs, body, credit, license, author, url } }, missing: [] }.

Every public style, and the icons one has drawn (q is optional and narrows by name, title or tag):

GET https://chameleonicons.com/api/v1/styles
GET https://chameleonicons.com/api/v1/styles/cute?q=home

They answer { styles: [{ style, name, kind, icons, by, license, author }] } and { style, name, kind, count, icons: [{ name, title, v, tags }] }.