Getting started
Installation
Section titled “Installation”Pick the package for your framework:
npm install @ghs-hazard-pictograms/reactnpm install @ghs-hazard-pictograms/vuenpm install @ghs-hazard-pictograms/elementsnpm install @ghs-hazard-pictograms/cssQuick start
Section titled “Quick start”import { Ghs01ExplosivesExplodingBomb, PictogramById } from '@ghs-hazard-pictograms/react';
// Named component<Ghs01ExplosivesExplodingBomb width={64} />
// Dynamic by ID<PictogramById id="ghs01-explosives-exploding-bomb" width={64} /><script setup>import { Ghs01ExplosivesExplodingBomb, PictogramById } from '@ghs-hazard-pictograms/vue';</script>
<template> <Ghs01ExplosivesExplodingBomb :width="64" /> <PictogramById id="ghs01-explosives-exploding-bomb" :width="64" /></template>import { defineCustomElements } from '@ghs-hazard-pictograms/elements';defineCustomElements();<!-- Generic element --><ghs-pictogram pictogram-id="ghs01-explosives-exploding-bomb" width="64"></ghs-pictogram>
<!-- Named element --><ghs-ghs01-explosives-exploding-bomb width="64"></ghs-ghs01-explosives-exploding-bomb>import '@ghs-hazard-pictograms/css/sprite.css';<span class="ghs-ghs01" style="display:inline-block;width:64px;height:64px" role="img" aria-label="Explosives"></span>Finding pictogram IDs
Section titled “Finding pictogram IDs”Every pictogram has a slug ID based on its GHS code and name. Browse the
Pictogram Gallery to find the sign you need. The ID format is:
{code-lowercase}-{name-slugified}, e.g. ghs01-explosives-exploding-bomb.
TypeScript
Section titled “TypeScript”All packages ship full TypeScript types. The core package exports Pictogram and
PictogramCategory if you need them:
import type { Pictogram, PictogramCategory } from '@ghs-hazard-pictograms/core';Next steps
Section titled “Next steps”- See the full props/attributes for each package in the Packages section.
- Browse all 24 pictograms in the Pictogram Gallery.