@optiaxiom/icons
v1.13.0
Published
Readme
Axiom Icons Library
Material Symbols kit for use with the Optimizely Design System.
Getting Started
npm install @optiaxiom/iconsimport { IconTrashCan } from "@optiaxiom/icons";
function App() {
return (
<>
<IconTrashCan />
<IconTrashCan size="md" />
<IconTrashCan filled />
</>
);
}Check out our Icons Guide to learn more and explore all available icons.
Contributing
Adding new icons
- Find the icon name on Material Symbols
- Add an entry to
icons.jsonmapping the Material Symbols snake_case name to its component alias. For new icons, the alias must be the exact Material Symbols name in PascalCase — e.g."assured_workload": ["AssuredWorkload"]. The component is then exported as that alias prefixed withIcon(e.g.IconAssuredWorkload). - Run
npm run buildto fetch the SVGs and rebuild the package - Add a changeset (run
pnpm changesetfrom the repo root) with aminorbump for@optiaxiom/icons - Commit the updated
icons.json,src/index.ts,src/entries/*.ts,tags.json,svg/*.svg.d.ts, and the new.changeset/*.mdfile (thesvg/*.svgfiles themselves are gitignored and re-fetched at build time)
[!IMPORTANT] Commit
tags.jsonexactly as the build generates it (then formatted bypnpm lint). Never edit it by hand — not even to keep existing icons' tags when Google's metadata returns different ones. The file mirrors Google's current metadata plus any custom tags fromicons.json.
Adding custom icons
Only for designs Material Symbols has no equivalent for.
- Convert the Figma export to a single
<path>in Material'sviewBox="0 -960 960 960"(the 24px grid scaled by 40 and shifted up by 960), so it renders like every other icon. - Save it as
custom/<name>.svg, pluscustom/<name>-fill.svgif the icon has a filled state. Without one, the icon looks the same whenfilled. - Add an
icons.jsonentry with custom tags (see below). Custom icons get no tags from Google, so these are their only search terms. - Build, add a changeset, and commit as for any new icon, including the
custom/files.
A custom SVG takes precedence over a Material Symbol of the same name.
Adding custom tags
Google's metadata supplies each icon's search tags (used by the docs gallery and the MCP server). To add your own, write the entry as an object mapping each alias to its extra tags — e.g. "settings_slow_motion": { "SettingsSlowMotion": ["dxp"] }. Then run npm run build and commit the regenerated tags.json.
[!NOTE] Some existing icons use hand-picked aliases that differ from their Material Symbols name (e.g.
"account_circle": ["CircleUser"]). These exist only to keep parity with our legacy icons package and should not be used as a pattern for new icons.
How it works
Icons are fetched directly from Google Fonts as SVGs using the following parameters:
- Style: Rounded
- Weight: 300
- Grade: 200
- Optical size: 40px
The SVG files are committed to the svg/ directory. The icons.json file is the source of truth for which icons are included. At build time, a Rollup plugin converts each SVG into a React component.
See the main repository for general contribution guidelines.
License
Apache-2.0
