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 / ui-icon-package-builds

UI icon package builds

The UI icon build system turns one generated icon catalog into raw SVG files, framework components, and a web-served SVG distribution. It keeps the icon names, seven looks, metadata, and visual output aligned across the site and the published @thesvg/ui* packages.

Generated UI icon data

The generated data is the contract shared by the website and all UI icon packages. Source set files describe the glyphs, while the build records the available looks, sets, tags, release dates, quality results, and paths that downstream builders use. Current package releases also expose richer per-icon meaning data such as domain, concept, and modifiers.

Source and manifest contract

src/…/*.json is the source for the UI icon catalog. scripts/…/build-data.ts reads these sets, renders every glyph in the seven looks, checks slugs and quality, and writes the manifest at src/…/ui-icons.json together with one JSON file per look. The generated set import list at src/…/sets.generated.ts lets the site load the same source sets without maintaining a second list.

The manifest is the hand-off point for package builds. It names the icons and looks and points consumers to the generated look data or to the web path ui/…/{look}.svg.

References: scripts/…/build-data.ts• L1-13 scripts/…/build-data.ts• L27-39 scripts/…/build-data.ts• L63-75 scripts/…/build-data.ts• L90-103 src/…/ui-icons.json• L1 packages/…/CHANGELOG.md• L7-11

Derived SVG and site files

The look JSON files hold complete SVG text for each icon and look. @thesvg/ui copies that data into its published dist layout and also writes one plain SVG file per icon and look. The site build uses the same look files to create public/…/<look>.svg, which supports direct web and CDN-style access without treating those files as source.

Icons with a defined motion preset also have an animated SVG form in the raw package and in the site output. The shared motion rules remain plain CSS so the same idea works in an image file and in framework components.

References: packages/…/build.mjs• L1-26 scripts/…/emit-svgs.mjs• L1-24 scripts/…/anim-runtime.mjs• L1-22

Package surfaces

The package family offers different forms of the same catalog. The raw package serves tools and plain-file consumers, while framework packages wrap the same SVG markup in typed components and preserve per-icon imports for small bundles. The current package line is version 4.4.0 across the raw and framework packages.

Raw SVG package

@thesvg/ui is the web-neutral distribution. Its dist folder contains the manifest, the per-look JSON files, and svg/…/<look>.svg files. Its export map exposes these paths rather than a component runtime, so a build tool, CDN URL, design tool, or plain HTML page can consume the artwork directly.

The package uses the seven look names from the manifest. The SVG artwork uses currentColor, which lets inline use follow the surrounding text color; an image URL does not inherit that color from its page.

References: packages/…/package.json• L16-28 packages/…/build.mjs• L11-26 packages/…/README.md• L7-17 packages/…/README.md• L37-50 packages/…/CHANGELOG.md• L3-11

Framework binding packages

The framework packages share one package builder and differ only in the component profile for their target runtime. The builder creates shared support files, one module per icon, declarations, and root barrels. Each icon module contains an export for every look, which gives consumers both a simple package import and a focused per-icon subpath. React, Vue, and React Native publish ESM, CommonJS, and type entry points; Svelte publishes Svelte-aware component and type entry points.

PackageBinding surfaceMain package concern
@thesvg/ui-reactTyped React SVG componentsReact props, refs, motion, and optional lift shadow
@thesvg/ui-vueTyped Vue 3 componentsVue attributes, motion, and optional lift shadow
@thesvg/ui-svelteSvelte component files and declarationsSvelte-native component resolution and attributes
@thesvg/ui-react-nativeReact components backed by react-native-svgNative color input and native SVG support

The browser-oriented bindings use inner SVG markup and a shared runtime for scoped IDs and optional motion. The React Native binding uses full SVG text because its renderer does not provide browser currentColor or CSS filter behavior in the same way. This is a target-runtime difference, not a second icon catalog.

References: scripts/…/package-builder.mjs• L62-79 scripts/…/package-builder.mjs• L81-118 scripts/…/package-builder.mjs• L121-147 packages/…/build.mjs• L4-32 packages/…/build.mjs• L4-35 packages/…/build.mjs• L1-4 packages/…/build.mjs• L4-29 packages/…/package.json• L16-40 packages/…/package.json• L25-61 packages/…/package.json• L25-61 packages/…/package.json• L25-63

Web distribution

The web distribution has two related roles. @thesvg/ui is the installable raw-file package, while public/ui is a site build artifact served at the UI icon routes. Both are projections of the generated look files, so a change to the catalog must reach the data build before either distribution is rebuilt.

The UI icon web experience uses the catalog and the generated SVG paths for browsing and detail views. This page covers the build boundary; that page covers how people interact with the resulting web experience.

References: scripts/…/emit-svgs.mjs• L1-10 scripts/…/emit-svgs.mjs• L12-24 packages/…/build.mjs• L13-24 package.json• L8-16

Build pipeline

The build pipeline moves from source sets to committed generated data, then from that data to package and site outputs. A check mode compares generated content with the repository instead of changing it, which makes stale data visible in local and CI checks.

Data generation

Run pnpm ui:build after a source set changes. The data builder validates slug shape, duplicate names, tag coverage, SVG output, and quality thresholds before it writes the manifest, look files, and generated set list. pnpm ui:check runs the same generation logic in comparison mode and fails when those outputs are stale.

The root build runs SVG emission as part of the wider site build. It does not replace the data build; it consumes the committed look files produced by the data step.

References: package.json• L8-16 scripts/…/build-data.ts• L27-39 scripts/…/build-data.ts• L67-89 scripts/…/build-data.ts• L106-124

Package generation

Each UI package has a local build script. The raw package reads the manifest and look files directly. The React, Vue, Svelte, and React Native packages use the shared package builder, which reads the same manifest and embeds the matching SVG content into their generated dist files. Each package publishes only its generated dist output and README, so the package export map must continue to match that layout.

The generators clear their package dist directory before writing. This prevents removed icons and old look files from remaining as accidental public imports. Package metadata then limits publication to the generated dist content and its README.

References: scripts/…/package-builder.mjs• L13-23 scripts/…/package-builder.mjs• L66-79 scripts/…/package-builder.mjs• L122-147 packages/…/package.json• L22-28 packages/…/package.json• L32-40 packages/…/package.json• L41-47 packages/…/package.json• L39-45 packages/…/package.json• L41-47

Validation contract

The package checks protect the relationship between the manifest and generated output. Framework package tests rebuild the package and then verify that every icon and look has the expected files and barrel exports. They also check shared ID scoping and the animation runtime. The root UI test combines data freshness checks with these package checks.

The export maps are part of the contract. A generated file is not a usable public entry point unless the package map and barrel expose it for the intended module system. The package metadata also declares the peer runtime each binding needs, including React Native and react-native-svg for the native package.

References: scripts/…/validate-package.mjs• L1-18 scripts/…/validate-package.mjs• L24-50 package.json• L14-16 packages/…/package.json• L16-38 packages/…/package.json• L25-51 packages/…/package.json• L25-55

Package relationships

The package family has one data source and several consumer projections. The UI icons and design system page gives the broader model of the catalog, rendering engine, product routes, and distributions; this page narrows the view to the hand-off from generated data to published artifacts.

Source-to-consumer flow

When a UI icon source set changes, the system follows this sequence:

  1. The data build renders the source glyphs in every supported look.
  2. The manifest and look files become the shared generated contract.
  3. The raw package and framework packages read that contract and rebuild their dist directories.
  4. The site build emits web SVG files from the same look files.
  5. Package and root checks confirm that names, looks, files, and exports remain aligned.

This diagram shows how one generated catalog feeds the installable and web-facing surfaces.

flowchart TD
    A[UI source sets] --> B[UI data build]
    B --> C[Manifest and look JSON]
    C --> D[@thesvg/ui raw package]
    C --> E[Framework package builder]
    E --> F[@thesvg/ui-react]
    E --> G[@thesvg/ui-vue]
    E --> H[@thesvg/ui-svelte]
    E --> I[@thesvg/ui-react-native]
    C --> J[Site SVG emission]
    J --> K[public/ui web distribution]

References: scripts/…/build-data.ts• L1-6 packages/…/build.mjs• L11-24 scripts/…/package-builder.mjs• L66-118 scripts/…/emit-svgs.mjs• L7-24

Change checklist

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

  • Changes to a source set or to the list of looks require pnpm ui:build before package or site builds. The generated manifest, look files, and set import list must stay together.
  • Changes to manifest slugs or look names affect raw SVG paths, framework file names, component exports, and package barrels at the same time.
  • Changes to SVG markup must remain valid for browser SVG and for react-native-svg; the native package does not share every browser behavior.
  • Changes to animation presets must cover both standalone SVG output and the copied framework runtime.
  • Changes to a package export map must match the generated file layout. Root exports and per-icon subpaths are separate public contracts.
  • Removing an icon or look requires a clean package rebuild so stale files do not remain importable.
  • Changes to package peer dependencies or entry-point conditions must stay aligned with the binding runtime and generated module format.

Important failure modes

TriggerConsequenceGuard
A source set changes without a data rebuildPackages and the site publish old or incomplete icon dataRun pnpm ui:build and pnpm ui:check
A generated manifest lists a slug or look that a package builder cannot readA package build stops or misses an icon exportKeep manifest, look files, and set data generated as one output group
A package build does not clear distRemoved icons or looks remain as stale public importsUse the package build scripts that remove dist first
A file exists but its export map or barrel omits itConsumers cannot resolve the expected root or subpath importCheck package exports and generated index files together
Browser SVG behavior is assumed in React NativeColor, filters, motion, or markup can render incorrectlyReview native binding rules and run the package validator
A source SVG contains invalid output or falls below the quality limitThe data build fails before packages can publishCorrect the source set or rendering input and rerun the data check
A binding declares the wrong peer runtime or module conditionA consumer can install the package but cannot load or render itKeep package metadata aligned with the generated binding surface

Key files

FileWhy to read it
scripts/…/build-data.tsDefines the generated manifest, look files, set list, and data checks.
src/…/ui-icons.jsonShows the shared icon, look, set, and web-path contract consumed by package builders.
src/…/sets.generated.tsShows the generated link from the site back to the source icon sets.
scripts/…/package-builder.mjsDefines the common framework package layout and generated module contract.
packages/…/build.mjsDefines the raw SVG package contents.
packages/…/build.mjsShows the React binding profile used by the shared builder.
packages/…/build.mjsShows the Vue binding profile used by the shared builder.
packages/…/build.mjsConnects the Svelte package to its generated component layout.
packages/…/build.mjsShows the native binding profile and its renderer-specific contract.
scripts/…/emit-svgs.mjsCreates the site-facing SVG distribution from generated look files.
scripts/…/validate-package.mjsChecks icon coverage, look exports, ID scoping, and animation support.
packages/…/package.jsonDefines the raw package name, export paths, build checks, and published files.
packages/…/package.jsonDefines the React package entry points, peer runtime, and publication contract.
packages/…/package.jsonDefines the Vue package entry points, peer runtime, and publication contract.
packages/…/package.jsonDefines the Svelte package entry points, peer runtime, and publication contract.
packages/…/package.jsonDefines the native package entry points and its React Native SVG peer contract.