Introducing a new way to review your PRs.

Read the announcement

glincker / thesvg

The open SVG brand library: 7,600+ brand logos and cloud icons (AWS, Azure, GCP) as official SVG. Search, copy, ship via npm, CDN, CLI, React, Vue, Svelte, Figma, VS Code, Raycast and MCP. Free, MIT, no gatekeeping.

View on GitHub

27 documents · Updated Nov 23, 2026

docs / icon-catalog-and-data-pipeline

Icon catalog and data pipeline

The icon catalog is the shared source for the project's brand, service, and sign-in SVG assets. It joins stable icon identities with metadata and artwork, then produces the data views used by the website, external consumers, and published packages. The browser flow is described in Web icon discovery and detail experience, family behavior in Icon families and brand grouping, and package output in Icon package builds and framework exports.

Catalog model

The catalog keeps identity, meaning, ownership, and artwork in one record. This lets each downstream view use the same icon identity instead of creating its own copy of the catalog.

Icon identity

An icon is identified by its URL-safe slug. Its title, aliases, categories, brand color, source links, license, collection, and optional guidance give people and tools enough context to find and assess it. The family field points to the parent brand slug when the icon belongs to a brand family.

Replacement records keep their own slugs. A newer record uses supersedes and the older record uses supersededBy, so a refreshed mark can become the preferred current mark without removing the older icon page.

References: src/…/icons.json• L1-20 src/…/icons.ts• L27-61 tools/validate-lineage.mjs• L17-50

Variant records

The variants map connects a semantic variant name to a public SVG path. Common variants include default, color, mono, light, dark, and wordmark forms. The path is the contract between metadata and artwork, so consumers use it to load the file rather than infer a file name.

Every new catalog record needs a default variant. Other variants are optional because the catalog describes the artwork that exists, not an assumed set of files.

References: src/…/icons.ts• L33-45 src/…/icons.json• L52254-52271 public/…/default.svg• L1-17 .github/…/validate-svg.yml• L121-164

Collection taxonomy

Collections preserve source taxonomies without making the main brand view too broad. The default website view keeps cloud architecture categories out of the main category counts, while an explicit AWS, Azure, GCP, or Kubernetes collection can show those categories.

This boundary changes discovery and counts, not the catalog record. An icon keeps its complete category list and collection metadata. A specialty collection can also remain in the shared catalog while being left out of generic published packages.

References: src/…/icons.ts• L14-24 src/…/icons.ts• L113-137 src/…/icons.json• L57-71 packages/…/catalog.ts• L13-24 packages/…/excluded-collections.json• L1-4

Icon-family relationships

An icon family groups a parent brand icon with child icons whose family field points to that parent. Categories describe what an icon represents or does; a family describes who owns it. A family page exists only when the parent and its current members reach the minimum family size.

Family membership is derived from the catalog. The system removes superseded members from family counts and lists, while keeping each old icon reachable on its own page. The sidebar summary and the public family API are generated from the same rule, so navigation and external data share the same family view.

References: src/…/families.ts• L5-13 src/…/families.ts• L23-71 src/…/family-current.ts• L13-32 src/…/generate-families.ts• L33-64 src/…/generate-api.ts• L91-119

Catalog lifecycle

The catalog lifecycle moves from source records and SVG artwork to enriched variants, quality checks, generated website data, and package outputs. A catalog change is complete only when its metadata, referenced artwork, and downstream projections agree.

Source assembly

An asset enters as a record in src/…/icons.json and one or more SVG files below public/icons/<slug>. The record names the public paths and metadata; the files provide the artwork served by the website and read by package builders.

Pull request checks keep the source predictable. They check unique and ordered slugs, required basic fields, valid colors, categories, and a default variant. SVG checks also require well-formed artwork with an SVG root and viewBox.

References: .github/…/validate-svg.yml• L55-103 .github/…/validate-svg.yml• L105-164 src/…/icons.json• L52254-52271

Variant enrichment

Variant enrichment fills missing artwork from the local svgl data set. It matches source records by title, slug, or alias, adds only missing variants, writes the SVG files, and updates the catalog paths.

The enrichment boundary accepts small SVG files with an SVG root and viewBox. It removes scripts, foreign objects, unsafe links, active event handlers, and external resource references before the asset enters the shared public tree. Repeated runs do not keep changing an already enriched record.

References: packages/…/enrich-svgl-variants.ts• L121-181 packages/…/enrich-svgl-variants.ts• L423-447 packages/…/enrich-svgl-variants.ts• L535-606 packages/…/sanitize-svg.ts• L151-163

Artwork optimization

Changed SVG files pass through a separate optimization step before they are finalized. The workflow filters each path through the shared license rule and a small manual skip list, then allows SVGO to rewrite only assets that are safe to modify. This protects artwork whose license or brand terms require the source SVG to remain unchanged.

References: scripts/svgo-protected.mjs• L1-17 scripts/svgo-skip-slugs.json• L1 src/…/license-terms.mjs• L1-9 .github/…/svgo.yml• L75-99

Validation gates

Validation protects the boundary shared by the website and packages. The source checks catch malformed entries and unsafe changed SVGs, while the package audit checks the complete public icon tree before publication.

Lineage validation separately checks that replacement links name known slugs and point both ways. Package pre-publish validation also checks output coverage, excluded collections, bundle size, required exports, safe identifiers, and import sanity. Repository checks then combine these data checks with lint, type checks, and the website build.

References: packages/…/audit-svg-sources.ts• L1-46 packages/…/audit-svg.ts• L32-70 packages/…/validate-dist.mjs• L38-99 packages/…/validate-dist.mjs• L101-174 .github/…/validate-svg.yml• L55-164 .github/…/check.yml• L23-50 tools/validate-lineage.mjs• L1-67

Data projections

The source catalog is projected into smaller shapes for different consumers. These projections preserve stable slugs and available artwork while changing how much metadata each consumer receives.

Website data

The Next.js website reads the typed catalog for server-rendered routes, counts, collection views, recent icons, and icon detail pages. The initial browser view receives a small summary; search and filtering load the full manifest from /api/icons-full.json and cache it for later use.

This split reduces the first page payload without creating a second source of truth. Development can fall back to the source JSON when generated API files are absent, while production reports a failed manifest load instead of showing an empty catalog.

References: src/…/icons.ts• L63-83 src/…/icons-manifest.ts• L1-53 src/…/icons-manifest.ts• L55-97 src/…/page.tsx• L1-9

Static API files

The website build regenerates public/api from the catalog. It publishes an icon registry, category counts, current family summaries, and a slim full manifest for browser loading.

The registry gives extensions enough identity, metadata, and variant keys to discover assets. Consumers fetch SVG content from icons/…/<variant>.svg; the generator does not create one JSON file per icon because the deployment has a file-count limit.

References: package.json• L5-9 src/…/generate-api.ts• L1-15 src/…/generate-api.ts• L45-70 src/…/generate-api.ts• L91-134

Family projections

Family data has two generated forms. src/…/families.json is a small sidebar index with names, counts, logos, and display tone. public/…/families.json is the machine-facing form with family URLs and current member slugs.

The website uses the same family rules for its index and family detail routes. Large families can add curated product groups and featured icons, while smaller families fall back to category-based groups. An icon detail page can show a short sibling strip that links to the complete family page.

References: src/…/generate-families.ts• L1-8 src/…/generate-families.ts• L40-68 src/…/page.tsx• L34-65 src/…/page.tsx• L62-128 src/…/family-strip.tsx• L20-55

Published package inputs

Published packages read the same catalog and public SVG tree. Generic icon and framework packages filter out specialty collections through one shared package boundary, while those collections remain available to the website and can ship in their own package. The core package embeds metadata and SVG strings, and framework packages project that shared data into framework-specific exports. The thesvg package follows the generated core package rather than maintaining a separate icon list.

The current core package is version 4.0.14 and describes a 7,600+ brand-icon catalog. Recent releases keep catalog and artwork changes inside the same package boundary: 4.0.13 preserves original SVGs when licenses forbid modification, and 4.0.14 adds wordmark variants for godonateme. The 4.0.8 release adds flags to the shared catalog and publishes them through a separate @thesvg/flags package, while 4.0.9 adds flags to package discovery surfaces. Version 4.0.0 adds a separate UI icon section and related UI packages without changing the existing brand package imports, names, or files.

The generic package build reads every variant from the catalog's public path after applying the shared collection filter. It keeps each readable listed variant, chooses a primary SVG in a fixed preference order, and skips records with no readable artwork. A shared path boundary prevents package generation from reading files outside the public icon tree. The build then emits per-icon ESM, CommonJS, and type modules together with package barrels; its checks also keep runtime JavaScript valid and protect slugs that collide with export names.

References: packages/…/README.md• L41-106 packages/…/package.json• L2-4 packages/…/package.json• L27-52 packages/…/catalog.ts• L13-24 packages/…/excluded-collections.json• L1-4 packages/…/build-icons.ts• L61-115 packages/…/public-svg.ts• L7-16 packages/…/variants.ts• L16-71 packages/…/codegen.ts• L65-118 packages/…/codegen.test.ts• L133-175 packages/…/validate-dist.mjs• L84-99 packages/…/CHANGELOG.md• L3-16

Downstream exposure

The catalog serves three broad audiences: website users, static-data consumers, and package users. Each audience gets an access pattern suited to its task while retaining the same slug and artwork paths.

Browser catalog

The browser resolves icons by slug for detail routes and uses titles, aliases, categories, collections, and family data for discovery. Variant paths supply previews, downloads, copy actions, and detail-page artwork.

Family relationships add an owner-based route beside category and collection routes. Read Web icon discovery and detail experience for the browser search and detail flow, and Icon families and brand grouping for family pages and grouping rules.

References: src/…/search.ts• L7-31 src/…/families.ts• L74-101 src/…/page.tsx• L143-164 src/…/page.tsx• L121-195

Static consumers

Extensions and other HTTP clients use the generated registry to discover icon identity, categories, licenses, and available variants. They then request the SVG file from its public path. Clients that need complete metadata can load the full manifest instead.

References: src/…/generate-api.ts• L54-70 src/…/generate-api.ts• L122-134 src/…/page.tsx• L540-575

Published packages

The core package exposes raw brand SVG strings and metadata through package-level and per-icon imports. React, React Native, Vue, and Svelte packages expose framework forms from the same generic package set, while thesvg provides a convenience package around the core data. Flags stay in the shared catalog but use the separate @thesvg/flags package instead of the generic brand packages. UI icons use separate @thesvg/ui packages, so the 4.0.0 release adds that product area without changing the brand package contract. Their build and release rules are covered in Icon package builds and framework exports.

References: packages/…/README.md• L54-89 packages/…/package.json• L27-52 packages/…/catalog.ts• L1-24 packages/…/CHANGELOG.md• L3-16 packages/…/package.json• L33-55 .github/…/release.yml• L47-59

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep every variants path aligned with a real file under public/icons.
  • Keep slug changes synchronized across detail routes, API records, family links, generated package files, exports, and saved recent-item references.
  • Keep family values pointed at existing parent slugs, and keep current-member counts consistent in src/…/families.json and public/…/families.json.
  • Keep supersedes and supersededBy links paired when a refreshed icon changes.
  • Run enrichment before accepting derived variant paths, and preserve its size, viewBox, and sanitization boundary for active content and external references.
  • Keep changed artwork subject to the shared license rule and the manual SVGO skip list. Do not optimize SVGs that require unmodified source artwork.
  • Keep package builds reading the catalog's variant paths directly. Preserve the shared collection exclusion boundary, the safe icons/…/<file>.svg path boundary, the primary-variant preference order, and the one-copy SVG representation in generated modules.
  • Regenerate API and family projections from the same catalog snapshot; do not hand-edit generated JSON.
  • Keep generated package identifiers safe when a slug contains punctuation, starts with a digit, is reserved, or collides with an export name.
  • Keep the expected generic package module count aligned with the catalog minus excluded collections. Specialty collections must not leak into generic package output.
  • Include package build and release fan-out changes when catalog data or public SVG files change.

Important failure modes

TriggerConsequenceGuard
A variant path has no matching SVGThe website cannot load that artwork and the package build may skip the icon when no readable variant remainsValidate changed assets and run package coverage checks
A variant path uses traversal or a non-SVG fileThe package build refuses to read it, so the expected variant is absent from the packageKeep catalog paths inside the icons/…/<file>.svg boundary
A slug changes without rebuilding projectionsRoutes, API records, family links, or imports can refer to different identitiesTreat slugs as public identifiers and rebuild all projections
A family points to an unknown parent or stale member setThe family disappears from indexes or shows the wrong ownerRebuild family data and verify family tests
A refresh link is one-way or points to an unknown slugCurrent and historical icon views disagreeRun tools/validate-lineage.mjs
Enrichment matches the wrong source recordAn icon receives artwork for another brandReview title, slug, and alias matches before accepting the change
An SVG contains active content, unsafe links, external resource references, raster data, or no viewBoxSource or package audits fail and publication stopsApply the shared sanitizer and SVG checks
An SVG that requires unmodified artwork enters the SVGO rewrite setThe workflow can alter artwork that its license or brand terms protectFilter changed paths with the shared license rule and manual skip list
The API generator is skipped before a production buildBrowser lazy loading and external discovery receive stale or missing dataRun the website build, which generates the API files first
A specialty collection is included in generic package outputThe same catalog entries can be duplicated across package boundaries or the generic package can publish assets owned by a specialty packageApply the shared exclusion list and run the distribution coverage check
The core package is stale when thesvg re-exports buildThe convenience package publishes an old icon setBuild the core package before its re-export package
Generated module code repeats SVG text or emits TypeScript syntax in runtime barrelsPackage size grows or plain Node and bundlers fail to load the packageKeep runtime code generation separate from declaration generation and run the code-generation tests

Key files

FileWhy to read it
src/…/icons.jsonDefines shared icon identity, metadata, lineage, family links, and variant paths.
public/icons/Holds the SVG artwork referenced by the catalog.
src/…/icons.tsDefines the typed catalog and basic lookup, collection, category, and recent-item rules.
src/…/families.tsDefines family membership, current-member filtering, family thresholds, and grouping choices.
src/…/family-current.tsDefines how refreshed icons replace older siblings in family views.
src/…/generate-families.tsGenerates the compact sidebar family index.
src/…/generate-api.tsGenerates registry, category, family, and full-manifest API projections.
packages/…/enrich-svgl-variants.tsShows how missing variants enter the catalog after matching and checks.
packages/…/sanitize-svg.tsDefines the cleanup boundary for imported SVG content and external references.
scripts/svgo-protected.mjsSelects changed SVG paths that the optimizer may rewrite after license checks and manual exclusions.
scripts/svgo-skip-slugs.jsonLists icon slugs that must bypass SVG optimization.
src/…/license-terms.mjsDefines the shared rule for licenses that require unmodified SVG artwork.
.github/…/svgo.ymlRuns optimization only for permitted changed SVGs and handles the resulting asset changes.
packages/…/audit-svg-sources.tsAudits the complete public SVG tree before package publication.
packages/…/public-svg.tsProvides the shared reader that maps catalog paths to public SVG artwork for package builders.
packages/…/variants.tsResolves catalog variant paths into package SVG data and selects the primary SVG.
packages/…/variants.test.tsProtects variant path resolution, primary selection, coverage, and path safety contracts.
packages/…/catalog.tsApplies the shared rule for which catalog collections generic packages build.
packages/…/excluded-collections.jsonNames specialty collections that stay in the shared catalog but ship outside generic packages.
packages/…/catalog.test.tsProtects the collection boundary and preserves catalog order after filtering.
.github/…/validate-svg.ymlDefines catalog-entry and changed-SVG quality gates.
tools/validate-lineage.mjsChecks reciprocal links between old and replacement icon records.
packages/…/build-icons.tsConverts catalog records and SVG files into core package modules.
packages/…/codegen.tsDefines generated icon modules, runtime barrels, and type declarations.
packages/…/codegen.test.tsProtects runtime import behavior, export compatibility, and SVG de-duplication in generated modules.
packages/…/validate-dist.mjsChecks that the published distribution matches the catalog boundary and remains usable by consumers.
packages/…/package.jsonDefines the current brand package boundary and its build, audit, validation, and pre-publish gates.
packages/…/README.mdDescribes the consumer-facing core package and its import and variant model.
packages/…/CHANGELOG.mdRecords recent icon and artwork releases, including the current 4.0.14 package boundary.