SVG tools and creator workflows
The application gives developers and creators one path from an SVG source to a usable asset. Users can choose a catalog icon or bring their own SVG into the browser, inspect it, compare library choices, copy it into a project or design tool, convert it to raster output, and prepare a contribution for review.
Workflow map
The workflows share the same goal: keep SVG source, preview, exported form, and contribution data connected while the user moves between the catalog, local browser tools, and external services. Catalog assets add known metadata and public URLs. User files remain local until the user chooses to create a GitHub submission.
This diagram shows the main paths from asset choice to reuse or contribution.
flowchart LR
A[Choose catalog icon] --> C[Select variant]
B[Paste or drop SVG] --> D[Local SVG workspace]
C --> D
E[Compare icon libraries] --> A
D --> F[Inspect and preview]
F --> G[Copy or open in tool]
F --> H[Download or convert]
D --> I[Add metadata and license]
I --> J[Create GitHub submission]
Asset entry points
Catalog asset entry
The catalog is the source for known SVG assets and their surrounding identity. An icon entry gives the user a stable slug, a title, available variants, categories, license information, and links to the brand or its guidelines. The detail page uses the selected variant as the source for copy, download, editor, and conversion actions. src/…/icons.ts• L19-50 src/…/icon-detail-page.tsx• L46-53 src/…/icon-detail-page.tsx• L122-138
The catalog also supports refreshed or alternate versions without hiding the older asset. Version links on the detail page let a user move between related entries when the catalog records that relationship. src/…/icon-detail-page.tsx• L282-311 src/…/icon-detail-page.tsx• L374-394
References: src/…/icons.ts• L19-50 src/…/icon-detail-page.tsx• L46-53 src/…/icon-detail-page.tsx• L122-138 src/…/icon-detail-page.tsx• L282-311
Personal SVG entry
The standalone viewer accepts pasted SVG text, a dropped file, or a file selected from the browser. It also imports a catalog icon through a search control or through /viewer?from=<slug>. The viewer keeps the working source in client state, so a local file is not uploaded as part of viewing. src/…/page.tsx• L71-101 src/…/svg-viewer.tsx• L41-93 src/…/svg-viewer.tsx• L122-143 src/…/quick-import.tsx• L26-107
Quick import uses the catalog manifest to match a slug, title, or alias. It places the selected default SVG into the same workspace as pasted and uploaded content. This lets a user inspect a catalog asset and a personal asset with the same tools. src/…/quick-import.tsx• L61-107
References: src/…/page.tsx• L71-101 src/…/svg-viewer.tsx• L41-93 src/…/svg-viewer.tsx• L122-143 src/…/quick-import.tsx• L26-107
Selection and comparison
Library comparison
The comparison surface helps a user choose an icon source before starting an asset workflow. It compares theSVG with other libraries across brand coverage, cloud collections, variants, delivery methods, editor extensions, and contribution support. Its purpose is selection guidance rather than comparison of two SVG files. src/…/page.tsx• L217-239 src/…/page.tsx• L294-359
The comparison also states when a library fits a need. A user who needs multi-color brand marks and several delivery tools can choose theSVG. A user who needs only UI icons or a broad aggregator can choose a different source. src/…/page.tsx• L361-401
References: src/…/page.tsx• L217-239 src/…/page.tsx• L145-203 src/…/page.tsx• L361-401
Inspection and reuse
Inspection and preview
The viewer turns SVG text into a small inspection workspace. It reports file size, dimensions, viewBox, element count, gradients, and masks or clips. Valid source appears in a live preview on checker, light, or dark backgrounds, while invalid source stays out of the rendered preview and disables copy and download. src/…/svg-viewer.tsx• L95-105 src/…/svg-viewer.tsx• L389-511 src/…/svg-utils.ts• L19-46
Before user-controlled source reaches the preview, the viewer removes high-risk active content such as scripts, event handlers, unsafe links, and embedded HTML. This protects the preview boundary. It does not change the source text used for copy or download. src/…/svg-utils.ts• L127-161 src/…/svg-viewer.tsx• L95-105
For the focused viewer flow, read SVG viewer and conversion. It covers input handling, inspection, preview, editor hand-offs, and raster output in more detail.
References: src/…/svg-viewer.tsx• L95-105 src/…/svg-viewer.tsx• L389-511 src/…/svg-utils.ts• L19-46 src/…/svg-utils.ts• L127-161
Copy and editor hand-offs
Copy actions adapt an SVG to the next place where a creator will use it. Catalog detail pages can copy raw SVG, JSX, Vue markup, a CDN URL, or a data URI. Usage tabs also provide React, Vue, HTML, Next.js, and CSS examples for a selected icon and variant. src/…/copy-formats.ts• L1-60 src/…/code-block.tsx• L27-82 src/…/code-snippets.ts• L70-130
The editor hand-off layer uses the form that fits each destination. CodePen and JSFiddle receive pre-filled HTML. Filagram opens as an editing or conversion partner. Figma and Sketch receive clipboard content for pasting. Illustrator and Photoshop receive a downloaded SVG. The icon detail page can give Filagram a public catalog URL for preloading, while a private pasted or uploaded SVG must be pasted there by the user. src/…/svg-utils.ts• L163-217 src/…/svg-utils.ts• L238-327 src/…/open-in-editor-menu.tsx• L86-205
References: src/…/copy-formats.ts• L1-60 src/…/code-block.tsx• L27-82 src/…/code-snippets.ts• L70-130 src/…/svg-utils.ts• L163-217 src/…/svg-utils.ts• L238-327 src/…/open-in-editor-menu.tsx• L86-205
Conversion and export
Conversion changes an SVG into a file that another tool or channel can use. The detail page can download the active vector variant, copy a data URI, or create PNG, JPG, and WebP output at a chosen size. The focused PNG controls offer 32 through 512 pixels. The wider download menu offers 32 through 1024 pixels. src/…/icon-detail-page.tsx• L420-455 src/…/download-menu.tsx• L35-47 src/…/download-menu.tsx• L243-299 src/…/png-export.tsx• L16-52
The conversion layer accepts either SVG text or a source URL. It keeps the source aspect ratio by using its viewBox or positive dimensions. JPG output uses a white background because JPG cannot preserve transparency. Conversion errors remain local to the export action and are shown as a retryable failure. src/…/svg-to-png.ts• L6-105 src/…/svg-to-png.ts• L107-203 src/…/png-export.tsx• L28-50
References: src/…/icon-detail-page.tsx• L420-455 src/…/download-menu.tsx• L35-47 src/…/download-menu.tsx• L66-117 src/…/download-menu.tsx• L243-299 src/…/png-export.tsx• L16-52 src/…/svg-to-png.ts• L6-105 src/…/svg-to-png.ts• L107-203
Contribution intake
Submission package
The submission workflow turns a creator's SVG into a structured GitHub issue. The creator uploads the file, reviews its preview and checks, adds the icon name and slug, and supplies optional brand, category, color, and guideline data. The generated body carries the SVG, the validation results, the proposed catalog entry, and the chosen license. src/…/page.tsx• L29-53 src/…/submit-form.tsx• L490-532 src/…/submit-form.tsx• L581-656
The form is an intake aid rather than a direct catalog write. It opens a pre-filled GitHub issue, or copies the same submission body for another hand-off. A separate pull-request path remains available for contributors who fork the repository, add the SVG and catalog entry, run validation, and open a pull request. src/…/submit-form.tsx• L645-667 src/…/page.tsx• L59-95
Read Icon submission and validation for the contribution checks and review path that follow this intake flow.
References: src/…/page.tsx• L29-53 src/…/page.tsx• L59-115 src/…/submit-form.tsx• L490-532 src/…/submit-form.tsx• L581-667
Validation checks
Submission validation gives the creator an early, readable result before the issue is created. It checks the 50 KB size limit, SVG/XML parsing, a root viewBox, embedded scripts or event handlers, and base64 raster images. The result keeps each check and message so the same evidence can appear in the GitHub issue. src/…/svg-validation.ts• L1-14 src/…/svg-validation.ts• L17-106 src/…/submit-form.tsx• L123-148 src/…/submit-form.tsx• L581-615
The viewer and submission form serve different decisions. The viewer decides whether it can safely preview and reuse the current text. The submission form records whether the proposed contribution meets catalog rules, but a failed check can still be included in an issue for maintainer review once the required name and license data are present. src/…/svg-viewer.tsx• L95-105 src/…/svg-viewer.tsx• L488-511 src/…/submit-form.tsx• L669-672
References: src/…/svg-validation.ts• L1-14 src/…/svg-validation.ts• L17-106 src/…/submit-form.tsx• L123-148 src/…/submit-form.tsx• L581-615 src/…/submit-form.tsx• L669-672
License and review context
License capture makes ownership and reuse context part of the submission rather than a later question. The form offers common public-domain, permissive, and Creative Commons choices. It also has an Other path for custom or unclear rights. That path needs a short description and marks the generated issue for maintainer triage. src/…/license-options.ts• L13-25 src/…/license-options.ts• L29-97 src/…/license-options.ts• L107-140
The selected license is written into both the issue details and the proposed catalog entry. The form therefore passes one license decision through creator guidance, issue review, and catalog metadata. src/…/submit-form.tsx• L589-635 src/…/submit-form.tsx• L645-656
References: src/…/license-options.ts• L13-25 src/…/license-options.ts• L29-97 src/…/license-options.ts• L107-140 src/…/submit-form.tsx• L589-635 src/…/submit-form.tsx• L645-656
Shared utility layers
Catalog manifest
The catalog manifest is the shared lookup contract between discovery and creator tools. Quick import and viewer deep links use it to resolve a slug and variant path. Icon detail views use the same entry shape to select a variant, label an export, and build a public source URL. The browser caches the full manifest after its first load so these surfaces resolve the same catalog identity. src/…/icons-manifest.ts• L1-59 src/…/icons.ts• L19-64 src/…/svg-viewer.tsx• L59-93
If a slug or variant path changes, the discovery page, detail page, viewer import, public asset URL, and creator-facing output can disagree. The manifest is therefore the main link between a catalog record and every creator workflow that consumes it. src/…/icons.ts• L19-50 src/…/icon-detail-page.tsx• L122-138 src/…/icon-detail-page.tsx• L414-426
References: src/…/icons-manifest.ts• L1-59 src/…/icons.ts• L19-64 src/…/svg-viewer.tsx• L59-93 src/…/icon-detail-page.tsx• L122-138 src/…/icon-detail-page.tsx• L414-426
SVG utility boundary
The shared SVG utility is the common boundary for recognizing, measuring, formatting, cleaning, and handing off SVG text. It keeps viewer behavior and icon-detail actions aligned when the same asset moves from inspection to copy, download, or an external tool. src/…/svg-utils.ts• L1-6 src/…/svg-utils.ts• L19-46 src/…/svg-utils.ts• L61-161
Raster conversion stays separate because it changes the asset type. It shares the source-text-or-URL input model and aspect-ratio expectation, then returns a browser file for download rather than reusable SVG text. src/…/svg-to-png.ts• L1-4 src/…/svg-to-png.ts• L115-125 src/…/svg-to-png.ts• L205-229
References: src/…/svg-utils.ts• L1-6 src/…/svg-utils.ts• L19-46 src/…/svg-utils.ts• L61-161 src/…/svg-to-png.ts• L1-4 src/…/svg-to-png.ts• L115-125 src/…/svg-to-png.ts• L205-229
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the catalog entry, variant file path, detail-page variant state, quick import, and
/viewer?from=<slug>behavior aligned. - Keep the viewer's render-safety rules separate from the submission checks. A rule that changes one decision may not belong in the other.
- Keep
DEEP_LINK_TARGETS, its hand-off behavior, and both editor action surfaces aligned so each destination has one clear contract. - Keep copy format names and variant filename rules aligned across detail tabs, quick commands, CDN links, and generated snippets.
- Keep raster formats, size choices, extensions, aspect-ratio rules, and transparency behavior aligned across the export controls and conversion utility.
- Keep submission form fields, generated issue headings, catalog entry fields, license triage labels, and maintainer review expectations aligned.
- Preserve the local-only viewer boundary unless the privacy and security model for user-provided SVGs changes with it.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A catalog slug or variant path is missing or stale | Quick import, detail actions, or public preloading can open the wrong asset or fail to load one. | Treat the manifest and public asset paths as one contract and check all slug-based entry points together. |
| Pasted or uploaded SVG text cannot parse or does not meet the viewer's basic shape check | The viewer does not render it, and its main copy and download actions stay unavailable. | Keep preview and action state behind the viewer validity decision. |
| User-controlled SVG reaches the preview without render cleanup | Script, event-handler, unsafe-link, or embedded-HTML content can become an active browser payload. | Sanitize before inserting source into the rendered preview. |
| Clipboard access is denied | Raw copy and Figma or Sketch hand-offs fail even when the SVG is valid. | Show the action error and keep download or file export available. |
| SVG has invalid XML, cannot load as an image, or cannot create a canvas context | PNG, JPG, or WebP export produces no file. | Catch conversion errors and let the user retry with another asset or variant. |
A submission uses Other without a description or omits a license | The form cannot enable submission, or the proposed license cannot be reviewed with enough context. | Validate the license pair and require a short description for custom or unclear rights. |
| Submission validation reports failed checks but the form still creates an issue | Maintainers may receive an issue that looks complete while its SVG is not catalog-ready. | Include every check result in the issue body and preserve the triage path for review. |
Key files
| File | Why to read it |
|---|---|
| src/…/page.tsx | Defines the local-only viewer product boundary and user-facing purpose. |
| src/…/svg-viewer.tsx | Shows the main inspect, preview, copy, download, import, and hand-off flow. |
| src/…/quick-import.tsx | Shows how catalog search becomes viewer source text. |
| src/…/page.tsx | Defines the library-choice comparison workflow. |
| src/…/icon-detail-page.tsx | Connects catalog identity and variants to creator actions. |
| src/…/code-block.tsx | Shows copy and usage outputs for projects and frameworks. |
| src/…/open-in-editor-menu.tsx | Shows catalog hand-offs to editors, playgrounds, and the viewer. |
| src/…/download-menu.tsx | Shows vector, data URI, and raster export choices. |
| src/…/svg-utils.ts | Defines shared SVG recognition, metrics, cleanup, formatting, and editor hand-off rules. |
| src/…/svg-to-png.ts | Defines browser-side raster conversion and file download behavior. |
| src/…/page.tsx | Explains the creator-facing submission path and catalog requirements. |
| src/…/submit-form.tsx | Builds the validation result, metadata form, and GitHub issue or copied submission. |
| src/…/svg-validation.ts | Defines the SVG checks shown during contribution intake. |
| src/…/license-options.ts | Defines accepted license choices and the maintainer-review path for unclear rights. |
| src/…/icons-manifest.ts | Defines the shared browser lookup used by catalog import and related workflows. |