Skip to content

@public-information-symbols/sprite

Terminal window
npm install @public-information-symbols/sprite

Inside the sprite, each symbol is identified by its code lowercased with hyphens — for example ac-001 for the first accessibility symbol.

Serve the sprite file as a static asset and reference it from your HTML. This keeps the sprite out of the document and lets the browser cache it.

<!-- Load the sprite file from your static assets directory -->
<svg aria-hidden="true" style="display:none">
<use href="/assets/sprite.svg#ac-001" />
</svg>
<!-- Render a symbol elsewhere on the page -->
<svg width="64" height="64" role="img" aria-labelledby="sym-title">
<title id="sym-title">Accessible toilets</title>
<use href="/assets/sprite.svg#ac-001" />
</svg>

Each <svg> that renders a symbol should have role="img" and an accessible name. The recommended pattern is to include a <title> element inside the SVG and reference it with aria-labelledby. For decorative symbols, omit the <title> and add aria-hidden="true" to the outer <svg>.