United Kingdom (UK)
Quick facts
Section titled “Quick facts”| Field | Value |
|---|---|
| Drive side | Left-hand |
| Language(s) | English, Welsh |
| Regulator | DfT (TSRGD 2016) |
| Code format | Diagram 503 / 670 / 7001 |
| Standard | TSRGD (Traffic Signs Regulations and General Directions) |
The @road-signs/uk package contains UK road signs as defined in the
Traffic Signs Regulations and General Directions 2016 (TSRGD). Signs are
identified by their TSRGD diagram numbers and sourced from Wikipedia / Wikimedia
Commons. The Highway Code traffic signs guide
is the authoritative reference for sign meanings and legal obligations.
Installation
Section titled “Installation”npm install @road-signs/ukSign categories
Section titled “Sign categories”| Category | TSRGD part | Description |
|---|---|---|
warning |
Part 3 | Hazard warnings — triangular, red border |
regulatory |
Part 2 | Signs giving orders — circular, red/blue |
direction |
Part 4 | Route and destination signs — rectangular, colour by road type |
information |
Part 5 | Informatory signs — rectangular |
temporary |
Part 7 | Road works and temporary signs — rectangular, orange/yellow |
import { signs, getSign, getSignByCode, getSignsByCategory } from '@road-signs/uk';
// Example below uses the real UK sign "300" — adjust to taste.
// All signssigns.length;
// By slug IDconst sign = getSign("300-camping-and-caravan-site-yd-270-m-ahead");
// By sign codeconst s = getSignByCode("300");
// All direction signsconst filtered = getSignsByCategory("direction");import { getSignsByCategory } from '@road-signs/uk';import { RoadSign } from '@road-signs/react';
const directionSigns = getSignsByCategory("direction");
export default function UKGrid() { return ( <div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}> {directionSigns.map((sign) => ( <RoadSign key={sign.id} sign={sign} size={64} /> ))} </div> );}<script setup>import { getSignsByCategory } from '@road-signs/uk';import { RoadSign } from '@road-signs/vue';
const directionSigns = getSignsByCategory("direction");</script>
<template> <div style="display:flex;gap:8px;flex-wrap:wrap"> <RoadSign v-for="sign in directionSigns" :key="sign.id" :sign="sign" :size="64" /> </div></template>Coverage
Section titled “Coverage”| Metric | Value |
|---|---|
| Signs scraped | 468 |
| Signs with SVG | 453 |
| Missing SVG | 15 |
| Overall | 97% |
| Category | Scraped | With SVG | Missing | % |
|---|---|---|---|---|
warning |
99 | 99 | 0 | 100% |
regulatory |
132 | 130 | 2 | 98% |
direction |
57 | 45 | 12 | 79% |
information |
117 | 117 | 0 | 100% |
temporary |
63 | 62 | 1 | 98% |
Standard: TSRGD (Traffic Signs Regulations and General Directions)
SVG sources:
- Wikimedia Commons — Warning signs of the UK
- Wikimedia Commons — Regulatory signs of the UK
- Wikimedia Commons — Information signs of the UK
- Wikimedia Commons — Direction signs of the UK
- Wikimedia Commons — Road works signs of the UK
- Wikimedia Commons — Road signs in the UK
Coverage data is also published in the @road-signs/docs package.
TypeScript types
Section titled “TypeScript types”import type { UKSign, UKCategory } from '@road-signs/uk';
type UKCategory = 'direction' | 'information' | 'regulatory' | 'temporary' | 'warning';
interface UKSign { id: string; // e.g. "601-no-entry" code: string; // TSRGD diagram number, e.g. "601" name: string; // e.g. "No Entry" description: string; category: UKCategory; svg: string; // inline SVG string assets: { svg: string; png: Record<number, string>; jpg: Record<number, string>; webp: Record<number, string>; };}