New Zealand (NZ)
Quick facts
Section titled “Quick facts”| Field | Value |
|---|---|
| Drive side | Left-hand |
| Language(s) | English, Māori |
| Regulator | NZTA (TCD Rule) |
| Standard | Traffic Control Devices Rule (NZTA) |
The @road-signs/nz package contains New Zealand road signs from the Traffic Control Devices Rule (NZTA).
Signs are sourced from Wikimedia Commons and are in the public domain.
Installation
Section titled “Installation”npm install @road-signs/nzSign categories
Section titled “Sign categories”| Category | Series | Description |
|---|---|---|
warning |
Warning | Hazard warnings |
regulatory |
Regulatory | Regulatory signs |
mandatory |
Mandatory | Mandatory actions |
information |
Information | Information and direction |
temporary |
Temporary | Temporary traffic management |
import { signs, getSign, getSignByCode, getSignsByCategory } from '@road-signs/nz';
// Example below uses the real NZ sign "RS51" — adjust to taste.
// All signssigns.length;
// By slug IDconst sign = getSign("rs51-locality-speed-limit");
// By sign codeconst s = getSignByCode("RS51");
// All prohibitory signsconst filtered = getSignsByCategory("prohibitory");import { getSignsByCategory } from '@road-signs/nz';import { RoadSign } from '@road-signs/react';
const prohibitorySigns = getSignsByCategory("prohibitory");
export default function NZGrid() { return ( <div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}> {prohibitorySigns.map((sign) => ( <RoadSign key={sign.id} sign={sign} size={64} /> ))} </div> );}<script setup>import { getSignsByCategory } from '@road-signs/nz';import { RoadSign } from '@road-signs/vue';
const prohibitorySigns = getSignsByCategory("prohibitory");</script>
<template> <div style="display:flex;gap:8px;flex-wrap:wrap"> <RoadSign v-for="sign in prohibitorySigns" :key="sign.id" :sign="sign" :size="64" /> </div></template>Coverage
Section titled “Coverage”| Metric | Value |
|---|---|
| Signs scraped | 417 |
| Signs with SVG | 407 |
| Missing SVG | 10 |
| Overall | 98% |
| Category | Scraped | With SVG | Missing | % |
|---|---|---|---|---|
warning |
152 | 151 | 1 | 99% |
priority |
0 | 0 | 0 | — |
prohibitory |
120 | 112 | 8 | 93% |
mandatory |
0 | 0 | 0 | — |
information |
145 | 144 | 1 | 99% |
Standard: Traffic Control Devices Rule (NZTA)
SVG sources:
Coverage data is also published in the @road-signs/docs package.
TypeScript types
Section titled “TypeScript types”import type { NZSign, NZCategory } from '@road-signs/nz';
type NZCategory = 'information' | 'mandatory' | 'regulatory' | 'temporary' | 'warning';
interface NZSign { id: string; // e.g. "w1-sharp-bend" code: string; // sign code, e.g. "W1" name: string; description: string; category: NZCategory; svg: string; // inline SVG string assets: { svg: string; png: Record<number, string>; jpg: Record<number, string>; webp: Record<number, string>; };}