Experiments

Carousel Controls

Carousel dots that grow into a progress bar and fill while the slide is on screen

December 3, 2026

  • Abstract gradient in violet, magenta and orange

Pick a dot, or pause it

These are the carousel controls from Apple's product pages: a pill of dots and a separate play button, where the current dot stretches into a bar that fills up while the slide is on screen. It is not a slider with a timer bolted on - the bar is the timer, and there is no setInterval anywhere in it. In the Human Interface Guidelines it is a page control1, and since iOS 17 UIKit ships this exact timed variant as UIPageControlTimerProgress2.

The fill is a single motion value, progress, animated from 0 to 1 over 5s, linear, because it is time made visible and time does not ease. When it lands on 1, the carousel advances to the next item. Pause stops the animation wherever it is, and play starts a new one from that value for whatever time is left - 5s * (1 - progress) - so the bar picks up from the same pixel with no elapsed-time bookkeeping and no drift between the bar and the slide. I first wrote it as a CSS keyframe with animation-play-state, which is lovely until you record it: the recorder that makes the preview clip steps its own clock, the keyframe ignored it, and the bar raced through each item in about a second. Clicking a dot re-keys the fill, which restarts it from empty on the new item.

The dot growing into a bar is a Motion spring on width, 0.4s at 0.15 bounce. I normally keep animation off layout properties, but here the neighbours genuinely have to move out of the way, and it is six 8px elements.

The loop is the part I almost shipped wrong. Going from the last slide back to the first, the track slid back through all six in half a second, which reads as a rewind rather than as the next slide. The fix is a copy of the first slide at the end of the track - the carousel moves forward onto the copy, then jumps to the real first slide without animating, and because the two are identical the jump is invisible.

The pill and the button are glass, and the Controls panel has a slider for how much. At 0 it is a flat opaque pill; turned up, the tint thins out, the backdrop blurs and saturates, and the rims catch light - all from one --glass custom property, so it is one dial rather than five.

If you prefer reduced motion, the carousel does not autoplay at all: it waits on the first slide until you press play, and moving between slides stops animating. Tabbing into the dots also holds the rotation, so the one you are reaching for does not move away from you.

References

  1. 1.Page controls · Human Interface Guidelines · Apple
  2. 2.UIPageControlTimerProgress · UIKit · Apple Developer

Would you like to see more of this?

One email each time a new experiment is published.

Next experiment

Collapsing Header

A large title that hands over to a compact bar as the list scrolls, read straight from the scroll position