Offline · no browser · CI-ready
Catch inaccessible SVG before it ships.
iconlens reads a standalone .svg file and tells you whether a screen reader can name it, then points at the exact line that breaks it. One command, no rendering, no network.
curl -fsSL https://raw.githubusercontent.com/srivtx/iconlens/main/install.sh | sh
Installs the iconlens binary with Bun. It is not on npm; bunx github:srivtx/iconlens#main runs it without installing.
$ iconlens icons/*.svglogo.svg errors:3 warnings:2 info:0ERROR SVG-NAME-001 Root svg has role="img" but no accessible name.ERROR SVG-NAME-002 aria-labelledby references missing id(s): nope.ERROR SVG-ID-006 Duplicate id "p"; ids must be unique.WARNING SVG-USE-007 <use> references missing target "#missing".WARNING SVG-FOCUS-008 tabindex="0" on a non-interactive element.
What it catches
The failures that make an icon silent or confusing to a screen reader, each with a plain explanation and a rule code you can look up.
- An icon with no name
- A graphic that a screen reader cannot name is announced as nothing useful. iconlens computes the name the way a browser would and reports when there is none.
- A name that points nowhere
aria-labelledbythat references a missing id, or a<use>that targets a symbol that does not exist, leaves the graphic unnamed or broken.- Duplicate ids
- Two elements with the same id make every reference ambiguous, and the second one silently wins.
- Decoration that takes focus
tabindexon a non-interactive element puts a dead stop in the keyboard order.- A title in the wrong place
<title>must be the first child of<svg>. Anywhere else, it is ignored.- A complex graphic with no description
- Charts and diagrams need more than a name; iconlens notes when a named graphic has no
<desc>.
Quick start
Install once, then point it at a file, a glob, or a directory. The exit code is the CI gate.
# install the binary$ curl -fsSL https://raw.githubusercontent.com/srivtx/iconlens/main/install.sh | sh# audit one file$ iconlens logo.svg# audit every icon in a directory, and fail CI on warnings$ iconlens --dir icons/ --fail-on warning
Full flags, exit codes, and the TypeScript API are in Usage.
Playground
Paste SVG markup or upload a .svg file. Everything runs in your browser; nothing is uploaded.
Runs entirely in your browser. Nothing is uploaded.
Choose or drop an .svg file
Drag a file onto this box. It never leaves this tab.
No SVG audited yet.
| Severity | Rule | WCAG | Location | Message |
|---|
Documentation
The landing page is the pitch. The details live on four short pages.
- Rules
- The eight checks, how the accessible name is computed, and the static pipeline behind a run.
- Usage
- Every CLI flag, the exit-code scheme, JSON output, and the library API.
- CI
- SARIF 2.1.0 and GitHub code scanning, with a workflow you can paste.
- FAQ
- Scope, limitations, and how iconlens compares to svglint, svgo, and axe-core.