@iso-safety-signs/elements
Installation
Section titled “Installation”npm install @iso-safety-signs/elementsRegistering elements
Section titled “Registering elements”Call defineCustomElements() once at your app’s entry point before using any elements.
import { defineCustomElements } from '@iso-safety-signs/elements';
defineCustomElements();Custom prefix
Section titled “Custom prefix”By default elements are registered as iso-*. Pass a custom prefix to avoid collisions:
defineCustomElements('my-prefix'); // safe to combine with defineCustomElements()// Registers <my-prefix-sign sign-id="...">, <my-prefix-e001-emergency-exit-left-hand>, etc.Generic element
Section titled “Generic element”Use <iso-sign> when the sign is determined at runtime via the sign-id attribute.
<iso-sign sign-id="e001-emergency-exit-left-hand" width="64" title="Emergency exit"></iso-sign>Named elements
Section titled “Named elements”Each sign also has a dedicated element named iso-{code} with no sign-id needed.
<iso-e001-emergency-exit-left-hand width="64" title="Emergency exit"></iso-e001-emergency-exit-left-hand><iso-p002-no-smoking width="48"></iso-p002-no-smoking><iso-w021-flammable-material width="48"></iso-w021-flammable-material>Attributes
Section titled “Attributes”| Attribute | Type | Required | Description |
|---|---|---|---|
sign-id |
string |
Yes (<iso-sign> only) |
Sign ID, e.g. "e001-emergency-exit-left-hand". |
width |
string |
No | Width in pixels as a string, e.g. "64". |
height |
string |
No | Height in pixels as a string, e.g. "64". |
title |
string |
No | Sets the SVG <title> for screen readers. |
description |
string |
No | Sets the SVG <desc> for additional context. |
aria-label |
string |
No | Labels the <svg> directly instead of via <title>/<desc>. |
All attributes are reactive — changing them updates the rendered SVG immediately.
Framework usage
Section titled “Framework usage”<!-- vite.config.ts: set compilerOptions.isCustomElement = (tag) => tag.startsWith('iso-') --><template> <iso-sign sign-id="e001-emergency-exit-left-hand" width="64" title="Emergency exit" /></template>// In your NgModule or standalone component, add CUSTOM_ELEMENTS_SCHEMAimport { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@Component({ template: `<iso-sign sign-id="e001-emergency-exit-left-hand" width="64" title="Emergency exit"></iso-sign>`, schemas: [CUSTOM_ELEMENTS_SCHEMA],})export class AppComponent {}Accessibility
Section titled “Accessibility”Each element renders an <svg> with role="img". Provide a title attribute to give the sign an accessible name. For decorative usage, omit title and set aria-hidden="true" on the element itself.