Vehicle Registration Input

A UK vehicle registration field that auto-formats as you type and decodes the plate format, age and issuing region — for load tickets, transfer notes, gate logs and haulage records.

$bunx shadcn@latest add @nx-ui/vehicle-registration-input
Registry item
Installs withutilsvehicle-registration

Basic usage

Uncontrolled by default. Auto-uppercases and inserts the canonical space as you type.

Controlled

The normalised value (no spaces) is reported via onValueChange, alongside the full decoded parse.

Current format · registered March 2012–August 2012 · Anglia

Stored as AB12CDE

Live hint line

showHint surfaces the detected format, age identifier and memory-tag region as you type, announced politely for screen readers.

Current format · registered March 2024–August 2024 · London

Northern Ireland format

Enter a UK registration

Validation states

strict (default true) marks aria-invalid once the field is touched and holds a complete-but-unrecognised value.

Not a recognised UK format yet

Blur the field — Q is never used in a current-format plate.

Not a recognised UK format yet

Plate variant

A physical number-plate rendering — rear (yellow) is the default shorthand for plate, front (white) opts in explicitly. Fixed plate colours are a deliberate exception to the token-only rule.

Every format, plate-rendered

Current, prefix, suffix, dateless and Northern Ireland — all render through the same component.

CurrentSept 2001 – present
PrefixAug 1983 – 2001
Suffix1963 – Jul 1983
Dateless (reversed)pre-1963
Northern Irelandno age identifier

Composition: gate check-in

A registration input alongside a haulier stub and arrival time, with the decoded parse shown as chips — a typical gatehouse check-in for a Nexus ReGen site.

Enter a registration to see the decoded plate summary.

API reference

Exported parts and their props, extracted from the component source.

…extends VehicleRegistrationInputProps