Examples
Each demo is the real component. Move into a box to use it yourself, or press 0.5× to watch the take at half speed.
Dropdown menu
The highlight comes from the menu’s own pointermove handler and the reorder from its click handler. The menu has no replay code. It only has data-ghost-id on the trigger and the items.
- Springs, not curves1,240 reads
- The cost of a hover3,810 reads
- Ghosts in the DOM2,275 reads
- A menu, slowly960 reads
Segmented control and switch
The pill and the tiles move on springs, so at 0.5× you can watch the pill catch up. Arrow keys move the selection with no animation, because a keyboard change should land instantly.
Typing
Key presses replay as keydown and keyup. Printable keys also insert text through an input event, which is what React’s onChange listens for. The list has no animation, because it changes on every key.
The recorder, replaying itself
A <Recorder> with captureSynthetic, inside a <GhostCursor>. The outer ghost records a take with the inner recorder and presses Preview, and a second ghost replays it.