Skip to content

@iso-safety-signs/elements

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

Call defineCustomElements() once at your app’s entry point before using any elements.

import { defineCustomElements } from '@iso-safety-signs/elements';
defineCustomElements();

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.

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>

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>
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.

<!-- 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>

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.