Skip to content

@iso-safety-signs/react

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

Each sign is available as a PascalCase named export derived from its code and name.

import { E001EmergencyExit } from '@iso-safety-signs/react';
export function App() {
return <E001EmergencyExit width={64} height={64} title="Emergency exit" />;
}

The component name pattern is {Code}{Name} — e.g. P001NoSmoking, W001Flammable, F001FireExtinguisher, M001WearEyeProtection.

Use SignById when the sign is determined at runtime.

import { SignById } from '@iso-safety-signs/react';
export function DynamicSign({ id }: { id: string }) {
return <SignById id={id} width={64} height={64} title="Safety sign" />;
}
Prop Type Required Description
width number No Width in pixels. Defaults to the SVG’s intrinsic width.
height number No Height in pixels. Defaults to the SVG’s intrinsic height.
title string No Sets the SVG <title> element for screen readers.
description string No Sets the SVG <desc> element for additional context.
Prop Type Required Description
id string Yes Sign ID, e.g. "e001-emergency-exit-left-hand".

All named component props also apply to SignById.

The package ships its own type declarations. Import the prop type if you need it:

import type { SignProps } from '@iso-safety-signs/react';

Every component renders an <svg> with role="img" and an aria-labelledby attribute pointing to the generated <title> and <desc> elements, which default to the sign name. Passing aria-label labels the <svg> directly instead. Ids are unique per instance, so the same sign can appear any number of times on a page.

// Fully accessible
<E001EmergencyExit
width={64}
title="Emergency exit"
description="Green sign showing a running figure with directional arrow"
/>

Decorative signs that are already labelled by surrounding text should omit title and add aria-hidden="true".