Icon font repository for Digital.ai UX — used standalone or with dot-components.
📖 Browse the demo →
DotIcon via dot-componentsimport { DotIcon } from '@digital-ai/dot-components';
<DotIcon iconId="home" />
<DotIcon iconId="settings" fontSize="large" tooltip="Settings" />
<DotIcon iconId="ai" ai={true} />
Full DotIcon documentation →
<link rel="stylesheet" href="./index.css" />
<span class="dot-icon">
<i class="icon-home"></i>
</span>
Never add the
icon-prefix to theiconIdprop —DotIconadds it automatically.
https://digital-ai.github.io/dot-icons/demo/
The demo lets you:
expander finds key)<DotIcon iconId="..." />), and HTML Code — all copyableicons.json line. On the hosted demo that works once the organization has approved the demo’s GitHub app; until then, run the demo locally (see Upload New in the demo)The repo is the source of the icon font. IcoMoon is no longer used: don’t import or export IcoMoon projects, and don’t edit selection.json by hand.
fonts/svg/<id>.svg: one SVG per icon.icons.json: one line per icon, with its id, its code (the font code point), its demo category, and its aliases (legacy class names for the same glyph, such as expander for key).npm run build generates everything else from those two: fonts/dot.woff2, dot.woff, dot.ttf and dot.svg, index.css, the demo’s icon list (demo/icons.js), and selection.json. The same input always gives the same bytes. Don’t edit a generated file by hand: the check on every pull request fails it.
selection.json is an IcoMoon project with every glyph, written for one more release as a way back to IcoMoon. After that the build stops writing it.
Step-by-step guide for designers: docs/adding-assets.md. It covers new icons, redraws, aliases, the naming rules, the check’s messages and what happens after the merge.
In short:
npm ci once, then add the icon with its file, its id and an existing category:
npm run add-icon -- ~/Downloads/my-new-icon.svg my-new-icon actions
The id is lowercase kebab-case, like my-new-icon. add-icon checks the SVG, copies it to fonts/svg/<id>.svg, adds a line to icons.json with the next free code, and runs npm run build. It refuses to run on main, commits nothing, and changes no file when something is wrong.
icons.json and every generated file, and open a pull request. When Check icons passes, post it in #dot-components on Slack.To add an icon by hand instead, save the SVG as fonts/svg/<id>.svg, add one line at the end of icons.json with the next free code and a comma on the line before it, and run npm run build:
{"id":"my-new-icon","code":"ea3b","category":"actions","aliases":[]}
A redrawn icon needs the glyph-change label on its pull request. Ids are never renamed or removed; add a second name as an alias instead.
Without a clone, add an icon from the demo: Connect GitHub, then Upload New, with the id, a category and the SVG file.
.svg that follows the export rules). It lists every problem, and Create Pull Request stays disabled until there are none.fonts/svg/<id>.svg and one line in icons.json at the next free code. It doesn’t build the font.npm run build on its branch and pushes the result. Check icons stays red until then; the pull request says how.The digital-ai organization restricts OAuth App access, so the hosted demo can open a pull request only once an org owner has approved its app. Until then, or if GitHub answers that the organization “has enabled OAuth App access restrictions”, use npm run add-icon, or run the demo from your clone with your own gh sign-in (gh auth login). In two terminals, from the repo root:
node demo/local-proxy.js
python3 -m http.server 5174
Then open http://localhost:5174/demo/. It connects through the proxy on its own.
A font glyph has one colour and no strokes, so add-icon, Upload New, npm run build and Check icons stop an SVG with:
add-icon, Upload New and Check icons stop it, and npm run build doesn’t, so the four 975-wide icons from IcoMoon keep their widthfill-rule="evenodd", which Figma often exports, gives a warning only. In Figma: a square frame such as 24 × 24, Outline stroke and Outline text, then Flatten, and one fill for every shape. Each message and its fix: docs/adding-assets.md.
The Check icons workflow rebuilds every pull request and compares it with its base branch. It fails when:
npm run build, for example after a hand edit to index.css or font files copied from an IcoMoon exportindex.css is removed, or points at a different code, for example icon-forward-outline was moved from \ea3a to \ea3bfonts/dot.ttf is removedicons.json breaks a rule: a duplicate id, alias or code, an entry without an SVG or an SVG without an entry, or a new icon whose code isn’t above every earlier code, whose id isn’t lowercase kebab-case, or whose category doesn’t existNew class names and new glyphs pass. If an existing icon is redrawn on purpose, add the glyph-change label to the pull request and the check runs again. The label doesn’t allow a removal, a renumbering or a metric change: published icons are never removed or renumbered.
If the generated files are out of date, run npm run build on the branch and commit what it changes.
To run the check before you push:
npm ci
npm run build
git worktree add ../dot-icons-main origin/main
npm run check -- --base ../dot-icons-main
npm test
dot-icons uses @font-face which Jest/jsdom cannot process. Add a style mock:
jest.config.js
moduleNameMapper: {
'@digital-ai/dot-icons': '<rootDir>/testing-utils/style-mock.ts',
}
testing-utils/style-mock.ts
module.exports = {};
Latest dot-icons not picked up by dot-components
Add a resolutions entry to your package.json:
"resolutions": {
"@digital-ai/dot-icons": "latest"
}
More information: dot design system — Icons