Renaming or retiring an icon
Rename safely: the old name keeps working through a deprecated alias until the next major version.
Last updated
A published name is public API: React and Vue component names, Flutter, Swift and Compose symbols, font classes, URLs
(/icon/<name>/), and toSvg('<name>'). Rename only to fix a real spelling or meaning problem (XIDS-NC 12).
cd tooling/generator
uv run scripts/icon.py rename old-name new-name # one icon
uv run scripts/icon.py rename old-name new-name --variants # and old-name-slash, old-name-plus ... follow it
uv run scripts/icon.py check
This renames the source file(s) and records "old-name": "new-name" in aliases.json. After the next build:
| Package | What keeps working |
|---|---|
@xerobi/icons-react, -react-native, -vue |
OldName is still exported, marked @deprecated Renamed to NewName in TypeScript |
@xerobi/icons-core |
toSvg('old-name') resolves; aliases lists every retired name |
Others (Web Component, font, Flutter, Swift, Compose, SVG files, /icon/old-name/ URL) |
Do not keep the old name. Say so in the release notes |
Rules: the old name must no longer be an icon, the new one must exist, and aliases never chain (lint alias). Never reuse a
retired name for a different drawing.
Duplicates: if two icons turn out to be the same concept (lint dup, or the seven pairs in
scripts/duplicates-baseline.json with status review), delete one and alias it to the other with icon.py rename, rather than
keeping both drawings.
Removing an alias is a breaking change: do it only in a major version, with a migration note.