Pagination
Page numbers with one pill that travels to the page you picked instead of blinking there.
page 1 of 5
Build pagination whose active pill travels between the numbers. Structure: a pill-shaped row holding a previous arrow, the page numbers, and a next arrow. Every cell is a FIXED square (about 30x30), so the row does not reflow when a two-digit number appears. The motion: ONE shared layout element (framer-motion layoutId, or a View Transition name) that moves between the number cells. Re-colouring each cell instead makes the change a blink, and a blink carries no direction, which is the entire point of animating pagination at all. Spring, stiffness 520, damping 40. Pagination is a utility that gets pressed repeatedly, so the travel must FINISH before the next press rather than linger. Disable and fade the arrows at the first and last page. An arrow that silently does nothing teaches people the whole control is broken. Colour: the current number takes on-primary ink over the accent pill; the rest sit in muted ink. Leaving every number the same colour and changing only the background makes the current page hard to find at a glance. Accessibility: - aria-current="page" on the active number - real aria-labels on the arrows and the numbers ("Page 3", not "3" alone) - a polite live region reading "page 3 of 5", because the travelling pill is purely visual and a screen reader gets nothing from it Under prefers-reduced-motion, drop the shared layout and render the pill directly on the current page. Colors as tokens: accent for the pill, on-primary for the active number, muted for the rest, surface and border for the track. Build the component, not this demo of it. - Ambient motion that IS the component may loop: a drifting background, a marquee, a spinner while something is genuinely loading. - Do not add any timer, interval, loop or script that performs a person's action by itself. No auto-hover, no auto-click, no cycling through states, no pretend submitting, no replaying the interaction on a schedule. - Every state that answers a person waits for a real event from that person. - Placeholder copy and sample content are welcome. Simulated behaviour is not.