Make a repository of icons with chassis-icons init, save your SVG files into it, build the set, and release it as a package or an archive.
Introduction
This guide takes you from an empty folder to a repository of icons, a first build, and a release. The repository is yours: chassis-icons init writes its files once, you save your SVG files into source/, and the chassis-icons command builds them. The examples make acme-icons, the repository of the team Acme: the package @acme/icons, the font acme-icons and the class prefix ai.
To use a set that a team has released, nothing is built: install its package, and the pages of Use in Project show how a page draws an icon from it.
Prerequisites
The repository needs Git, Node.js 22.12 or later, and npm or pnpm. init writes the workflows and the instructions for the package manager that --pm names, npm unless you say otherwise.
Create the repository
chassis-icons init writes a repository of icons into a new folder. --name is the name of the package, --font the name of the font, and --repository the repository on GitHub, which the README of the set links:
npx @chassis-ui/icons init acme-icons --name @acme/icons --font acme-icons --repository acme/acme-icons
cd acme-icons
git init
npm installWith pnpm, run pnpm dlx @chassis-ui/icons init acme-icons --pm pnpm with the same options, then pnpm install.
The class prefix is the first letter of each part of the font name, ai, unless --prefix names another. The folder now holds package.json with the chassis.build block, the scripts and the dependency on the builder, .gitignore and .nvmrc, a changelog, the instructions for AI coding agents in AGENTS.md and CLAUDE.md, and the workflows of CI and of a release. @chassis-ui/icons is a development dependency, and every command runs from the repository. There is no README yet: the build writes it.
Save the icons
Make source/ and save your SVG files into it, one file per icon, with no folder inside it:
mkdir source
cp /path/to/your/icons/*.svg source/The name of a file is the name of its icon: bar-line.svg is the icon bar-line. The pages of Icon Design say what a file needs to be an icon: a name in kebab-case, the frame of the set, one color and filled shapes only. The build only reads source/, and never changes a file there.
Check the files before the first build:
npm run lintThe lint names each file that cannot be an icon, and why, and ends with one line when every file can.
Describe the set
Everything that is particular to the set is in package.json: the details of the package, and the chassis.build block that the build reads. init wrote this block for the font acme-icons, with header, the lines of the comment at the top of each stylesheet, left out here:
{
"chassis": {
"build": {
"name": "acme-icons",
"prefix": "ai",
"frame": 24,
"styles": [],
"pairs": [],
"startCodepoint": "f101",
"formats": ["woff2", "woff"],
"ligatures": false
}
}
}With this block the font is acme-icons, its files are dist/web/acme-icons.css, dist/web/acme-icons.woff2 and so on, and the class of an icon is ai-<name>. The set has no styles yet: with "styles": ["line", "fill"] a name ends in one of them, and with "pairs": [["line", "fill"]] an icon comes in both. The build writes the files of the web only, until "targets": ["ios", "android"] adds those of iOS and Android. Configuration describes each setting.
When a project reads icons of the set by name, list them in chassis.checks.json beside package.json, and npm run verify fails when one of them is gone:
{
"contracts": [{ "reader": "the toolbar of the app", "icons": ["bar-fill", "ring-line"] }]
}Build and verify
Build the set, and check it:
npm run build
npm run verifyThe build writes dist/: dist/svgs/, one optimized file per icon; dist/web/, the font acme-icons in each format with its stylesheets, the sprite and the code points by name; and dist/icons.json, the index of the set. Beside it, the build writes codepoints.json, the registry of the code points; README.md, with the code for your font name and your prefix; and the fields of package.json that name the files. dist/ is not committed: .gitignore names it, and the release builds it again. Commit the other files with source/ and the lockfile of the install, which the workflows install from. verify fails when the source does not build twice to the same files, or when a committed file that the build writes is not what the source builds.
To see the set, write its page and serve it:
npm run previewThe command writes the page of the set into preview/ and serves it at http://localhost:4325/ until you stop it. Open the address in a browser to see every icon with its name, and click one for its class, its code point and the code that draws it. preview/ is not committed.
Use the output
The output for a page is in two folders of dist/, which a project takes as they are:
cp -r dist/web dist/svgs /path/to/your-project/static/icons/README.md, which the build wrote for the set, shows the font class, the sprite, an SVG file and Sass with your font name and your prefix, and the pages of Use in Project describe each way at length. With the targets ios and android, an app takes the files of dist/ios/ and dist/android/ from the archives of a release, as iOS and Android shows.
Release a version
A release is a push to main with a new version in package.json and its entry in CHANGELOG.md. The workflow that init wrote lints the source, verifies the set, builds dist/, publishes the package to npm, and creates the tag v<version> and its GitHub release, with the changelog entry as its text and the archive acme-icons-web-<version>.zip of the output and the page of the set attached, and one archive per target, such as acme-icons-ios-<version>.zip. A push whose version npm has and whose tag exists releases nothing.
The workflow publishes with npm trusted publishing, so it needs no token: on npmjs.com, the package trusts the repository acme/acme-icons and the workflow file release.yml. For a set that is not published, set "private": true in package.json: the release is then the tag, the GitHub release and its archives. Publishing covers what the workflow reads of package.json.
Troubleshooting
Each entry gives the message or the symptom, then the cause and the fix.
File is refused
npm run lint prints a line such as <file> has the viewBox "0 0 32 32": it has to be "0 0 24 24". The file is not drawn on the frame of the configuration. Export it on the frame, or set chassis.build.frame to the frame of your icons. Source lint lists every message.
Committed file is stale
npm run verify prints <file>: changed. It is not what the source builds: run the build, and commit it. A file of source/ or the configuration changed after the last build, and codepoints.json, README.md or package.json is older. Run npm run build, and commit the file with the change.
Contract icon is missing
npm run verify prints "<name>" is missing, and <reader> reads it by name. chassis.checks.json lists an icon that source/ does not have. Restore the file, or remove the name from the list when no project reads it any more.
Next steps
Continue with one of these pages:
- Build system: every command, setting and check.
- Names and styles: how the name of a file becomes the name of an icon.
- Icon font: draw an icon of your set on a page.