Speed Race
ProNewGeneration speed shown as a race: each model writes the same page at its own rate against one clock, with running token counts and a replay.
Installation
pnpm dlx shadcn@latest add @viewport/speed-race
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| title | string | "Generation speed" |
| models* | RaceModel[] | — |
| duration | numberHow long the race runs, in seconds. The fastest model fills its page in exactly this time. | 3 |
| lines | numberHow many lines of text each page holds. | 14 |
| className | string | — |
Accessibility
- Named as an image that states each model's speed, so the animation is not the only source.
- Starts when it scrolls into view and never loops on its own.
- Shows the finished state under reduced motion.
- Frames are written to the elements directly; nothing re-renders while it plays.