Icon maintenance
This page explains how icons are organized and maintained in this repository.
Files
Each icon is made of two source files:
text
icons/<icon-name>.svg
icons/<icon-name>.json.svgstores the icon shape..jsonstores stable category IDs, Chinese default metadata, tags, and required Englishi18n.enmetadata.
Related files:
categories/*.json: category titles, category icons, and English category titles.docs/: generated documentation pages, search data, category pages, and icon detail pages.
Icon Metadata
YCloud Icons is Chinese-first at the source-data level:
nameis the Simplified Chinese icon name.tagsare Simplified Chinese search tags.use-casesare Simplified Chinese usage phrases. Use an empty array when none are known.categoriesare stable category slugs, not display text.i18n.en.name,i18n.en.tags, andi18n.en.use-casesare required for English docs and English search. Category translations are maintained incategories/*.json.
Example:
json
{
"$schema": "../icon.schema.json",
"use-cases": [],
"name": "Simplified Chinese icon name",
"tags": ["Simplified Chinese tag"],
"categories": ["arrows", "navigation"],
"i18n": {
"en": {
"name": "circle arrow up",
"tags": ["arrow", "up", "circle"],
"use-cases": []
}
}
}Add an icon
- Add
icons/<icon-name>.svg. - Add
icons/<icon-name>.json. - Reuse existing category slugs from
categories/*.json, unless the change explicitly adds a new category. - Run validation.
If the SVG comes from a design tool, optimize it first:
sh
pnpm optimizeDelete an icon
Delete both files:
text
icons/<icon-name>.svg
icons/<icon-name>.jsonThen check whether any category icon, alias, deprecation migration, or documentation example still references the icon.
Update an icon
- Shape only: update
icons/<icon-name>.svg. - Metadata only: update
icons/<icon-name>.json. - Rename: rename both
.svgand.json, update examples if needed, and add aliases when appropriate.
Add or update a category
Categories are defined in categories/*.json.
json
{
"$schema": "../category.schema.json",
"title": "Simplified Chinese category title",
"icon": "compass",
"i18n": {
"en": {
"title": "Navigation & Places"
}
}
}Rules:
titleis the Simplified Chinese display title.i18n.en.titleis the English display title.iconmust point to an existing icon.- Icon metadata may only reference category slugs that already exist or are added in the same change.
Validation
Run at least:
sh
pnpm checkIcons
pnpm lint:json
pnpm --dir docs docs:build:no-ogIf the change affects package exports or runtime behavior, also run the related package build, for example:
sh
pnpm --filter @ycloud-web/icons-react build
pnpm --filter @ycloud-web/icons-vue build