Skip to content

@iso-safety-signs/sprite

Terminal window
npm install @iso-safety-signs/sprite

The package ships a single sprite.svg file containing all signs as <symbol> elements. Symbol IDs are the sign codes in lowercase (e.g. e001, p001, m001, w001, f001).

Serve sprite.svg as a static asset and reference it with a full path. No inline HTML changes needed.

<svg width="64" height="64" role="img" aria-label="Emergency exit">
<use href="/assets/sprite.svg#e001"></use>
</svg>

Symbol IDs are the sign code lowercased with no additional segments:

SignSymbol ID
Emergency exite001
No smokingp001
Wear eye protectionm001
Flammable materialw001
Fire extinguisherf001

The <use> element does not inherit an accessible name from the referenced <symbol>. Always wrap <use> in an <svg> that carries role="img" and either aria-label or aria-labelledby.

<!-- Correct -->
<svg width="64" height="64" role="img" aria-label="Emergency exit">
<use href="/assets/sprite.svg#e001"></use>
</svg>
<!-- Also correct — label defined elsewhere -->
<svg width="64" height="64" role="img" aria-labelledby="sign-label">
<use href="/assets/sprite.svg#e001"></use>
</svg>
<span id="sign-label">Emergency exit</span>