Icon maintenance
This page explains how icons are organized and maintained in this repository.
Files
Each icon is made of two source files:
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 keys, Chinese titles, and English titles.docs/: generated documentation pages, search data, category pages, and icon detail pages.
Generic icons, business icons, and illustrations all use kebab-case file names.
Business-specific icons live in business-icons/<color-mode>/*.svg. The first-level folder must be outlined, filled, or multicolor, and it controls the cleanup and package-generation behavior. Each SVG needs same-name metadata JSON. Color-mode display names live in business-icons/<color-mode>/index.json, while business-icons/index.json and business-icons/metadata/index.json are generated; URL-based remote lookup snapshots are copied into docs/public/metadata during docs builds. See Business icons.
Illustrations live in illustration-icons/<category>/*.svg; the first-level folder is the category, and unclear assets should use other. They do not go through color conversion or size cleanup, and generated components default to width="100%" and height="auto". Each SVG needs same-name metadata JSON, while illustration-icons/index.json and illustration-icons/metadata/index.json are generated; URL-based remote lookup snapshots are copied into docs/public/metadata during docs builds. Package subpaths use @ycloud-web/icons-*/illustration, while static assets use @ycloud-web/icons-static/illustration-icons/<category>/<name>.svg.
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:
{
"$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:
pnpm optimizeDelete an icon
Delete both files:
icons/<icon-name>.svg
icons/<icon-name>.jsonThen check whether any 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.
{
"$schema": "../category.schema.json",
"title": "Simplified Chinese category title",
"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
For generic icon additions, removals, or updates, run at least:
pnpm checkIcons
pnpm lint:json
pnpm lint:svg:icons
pnpm docs:build:no-ogFor business icons and illustrations, run their index generator, asset metadata generator, and family-specific SVG validator. See Business icons and Illustrations for the exact commands.
If the change affects package exports or runtime behavior, also run the related package build, for example:
pnpm --filter @ycloud-web/icons-react build
pnpm --filter @ycloud-web/icons-vue build