Skip to content

@public-information-symbols/vue

Terminal window
npm install @public-information-symbols/vue

Every symbol ships as a named Vue component. The component name is derived from the symbol ID by converting it to PascalCase.

<script setup lang="ts">
import { Ac001FullAccessibilityOrToiletsAccessible } from '@public-information-symbols/vue';
</script>
<template>
<Ac001FullAccessibilityOrToiletsAccessible :width="64" :height="64" title="Accessible toilets" />
</template>

Use SymbolById when the symbol is determined at runtime — for example, from an API response or user selection.

<script setup lang="ts">
import { SymbolById } from '@public-information-symbols/vue';
const symbolId = 'ac-001-full-accessibility-or-toilets-accessible';
</script>
<template>
<SymbolById :id="symbolId" :width="64" :height="64" title="Accessible toilets" />
</template>

Shared props (all named components and SymbolById)

Section titled “Shared props (all named components and SymbolById)”
PropTypeRequiredDescription
widthnumberNoWidth of the rendered SVG in pixels.
heightnumberNoHeight of the rendered SVG in pixels.
titlestringNoAccessible name injected as <title> in the SVG.
descriptionstringNoLonger description injected as <desc> in the SVG.
PropTypeRequiredDescription
idstringYesSymbol ID, e.g. ac-001-full-accessibility-or-toilets-accessible.

The package ships with full TypeScript declarations. Use :width and :height (dynamic bindings) to pass numeric values; use plain title="…" for static strings. The id prop on SymbolById is typed as string — consult PISymbol from @public-information-symbols/core for valid IDs.

Always supply a title (and optionally a description) so screen readers can announce the symbol’s meaning. When a title is provided, the component adds role="img" and aria-labelledby to the SVG automatically. For decorative symbols, bind aria-hidden="true" on the component.