Speed Trap
One car's speed trap reading in big figures, with the best of the session under it and a flash on the lap the record changes hands.
Fed by the invented race simulator on this page. The Replay page runs on lap-time data, which carries no speed, so this item never appears there.
The figures roll with the shared Rolling Number, upward for a faster reading and downward for a slower one, and a reading that is the session best flashes once in its own presence boundary. Under reduced motion the flash collapses to the colour change and the digits do not roll.
The card is a plain region, not a live one: the trap fires for every car on every lap, and announcing that would talk over the rest of the page. A page that wants the record spoken should own that announcement itself.
Preview
Lap 0 / 70
Playground
The car the trap reading is shown for.
Readings are given in km/h; mph converts them.
How big the figure is.
Off drops the line under the figure, for a card that only reports one car.
Simulator tick in ms
Installation
Register the boxbox namespace once per project:
bunx shadcn@latest registry add @boxbox=https://react-boxbox.vercel.app/r/{name}.jsonThen add the component:
bunx shadcn@latest add @boxbox/speed-trap
Props
| Name | Type | Default | Description |
|---|---|---|---|
| code | 'EVO' | 'MSO' | 'TRE' | 'NVA' | 'AQU' | 'SDA' | EVO | The car the trap reading is shown for. |
| unit | 'kph' | 'mph' | kph | Readings are given in km/h; mph converts them. |
| size | 'md' | 'lg' | md | How big the figure is. |
| showBest | boolean | true | Off drops the line under the figure, for a card that only reports one car. |
| speed | number | 1500 | Simulator tick in ms |
Dependencies
- motion