Orbiting Circles

Items spread evenly on a circle that turns around a centre, for showing what connects to a product on a marketing page. Each orbit is one component; stack several with different radii and directions.

Examples

Two orbits

Three sources on a quick inner orbit, five on a slower outer one turning the other way.

Pause

Avatars on one orbit, with a button that pauses them where they are.

Installation

npx shadcn@latest add https://ui.ndekocode.dev/r/motion-orbiting-circles.json

Component API

OrbitingCircles

Draws one orbit centred in its container, which needs position: relative, a height and overflow: hidden. Every child becomes one item on the orbit.

PropTypeDefaultDescription
childrenReact.ReactNodeThe items, spread evenly around the circle.
radiusnumber120The radius of the orbit, in px.
durationnumber24Seconds for one full turn.
speednumber1A multiplier on the speed: 2 turns twice as fast.
reversebooleanfalseWhether the orbit turns anticlockwise.
startAnglenumber-90Where the first item sits, in degrees. -90 is the top of the circle.
iconSizenumber40The width and height of each item slot, in px.
pathbooleantrueWhether the orbit is drawn as a hairline circle.
pausedbooleanfalseWhether the orbit stops where it is.
classNamestringClasses for the orbit circle.

Accessibility and motion

  • The orbit turns with a CSS animation, so it keeps running smoothly while the page is busy. Each item turns the other way at the same pace and stays upright.
  • With reduced motion the items stay where they are, evenly spread on the circle.
  • Orbiting items are usually decorative: give the container role='img' and an aria-label that says what the picture shows.

Credits

Inspired by the orbiting circles of Magic UI, rebuilt on our materials and icon set.