@genart-dev/symbols
v0.1.0
Published
Curated vector symbol library for genart.dev — searchable SVG path data for generative art algorithms
Maintainers
Readme
@genart-dev/symbols
Curated vector symbol library for genart.dev — searchable SVG path data for generative art algorithms. Includes a built-in registry of symbols, Iconify integration for fetching thousands more, and validation utilities.
Part of genart.dev — a generative art platform with an MCP server, desktop app, and IDE extensions.
Install
npm install @genart-dev/symbolsUsage
import {
SYMBOL_REGISTRY,
searchSymbols,
resolveSymbol,
listCategories,
// Iconify integration
searchIconify,
fetchAndParseIcon,
// Validation
validateSymbol,
} from "@genart-dev/symbols";
// Search the built-in registry
const results = searchSymbols("tree");
// Resolve a symbol to SVG path data
const symbol = resolveSymbol("tree");
// Fetch from Iconify (ph, lucide, tabler, etc.)
const icon = await fetchAndParseIcon("ph:tree");
// → { id, name, iconifyId, paths: [{ d, fill?, stroke? }], viewBox }Symbol Categories

Iconify Integration
Fetch icons from any Iconify prefix. Safe prefixes included by default: ph, lucide, tabler.
import { searchIconify, fetchAndParseIcon, SAFE_PREFIXES } from "@genart-dev/symbols";
// Search Iconify
const results = await searchIconify("arrow", { prefix: "ph", limit: 10 });
// Fetch and parse a single icon
const icon = await fetchAndParseIcon("lucide:worm");
console.log(icon.paths); // [{ d: "M...", fill: "#222" }]
console.log(icon.viewBox); // "0 0 24 24"Iconify icon licenses
Icons fetched from Iconify are third-party works under their own licenses. Only prefixes from the SAFE_PREFIXES allowlist may be embedded — all use permissive licenses (MIT, ISC, or Apache-2.0) except Remix Icon which uses a custom license permitting embedding in larger works.
| Prefix | Library | License |
|--------|---------|---------|
| ph | Phosphor Icons | MIT |
| lucide | Lucide | ISC |
| tabler | Tabler Icons | MIT |
| heroicons | Heroicons | MIT |
| bi | Bootstrap Icons | MIT |
| mdi | Material Design Icons | Apache-2.0 |
| ri | Remix Icon | Remix Icon License v1.0 |
| carbon | Carbon Icons | Apache-2.0 |
| fluent | Fluent UI Icons | MIT |
When an icon is embedded in a .genart file, its provenance is recorded on the symbol (iconifyId, license fields) and a ThirdPartyNotice entry is appended to the file's thirdParty array. Exporters and distribution tools must surface these notices.
See THIRD-PARTY-LICENSES.md for full copyright notices, license obligations, and instructions for adding new prefixes.
API
| Export | Description |
|--------|-------------|
| SYMBOL_REGISTRY | Built-in symbol registry object |
| listCategories() | List all available symbol categories |
| searchSymbols(query, options?) | Search the built-in registry |
| resolveSymbol(id) | Resolve a symbol by ID to path data |
| resolveSymbolValue(value) | Resolve a symbol value reference |
| resolveAllSymbols(ids) | Batch resolve multiple symbols |
| searchIconify(query, options?) | Search Iconify API |
| fetchAndParseIcon(id) | Fetch and parse an Iconify icon |
| SAFE_PREFIXES | Allowed Iconify prefixes |
| validateSymbol(symbol) | Validate a symbol definition |
| validatePathData(d) | Validate SVG path data string |
| validateViewBox(viewBox) | Validate a viewBox string |
Related Packages
| Package | Purpose |
|---------|---------|
| @genart-dev/core | Plugin host, layer system |
| @genart-dev/format | .genart file format spec |
| @genart-dev/mcp-server | MCP server for AI agents |
Support
Questions, bugs, or feedback — [email protected] or open an issue.
License
MIT
