Docs
Circling Elements

Circling Elements

A component that creates a circling effect on its children.

Inspiration from Bakken & Bæck

Installation


npx shadcn@latest add "https://fancycomponents.dev/r/circling-elements.json"

Usage


You only need to wrap your elements with the CirclingElements component, everything else is taken care of by the component itself.

Under the hood, the component wraps all the children in a relative container, then sets all children to absolute to allow the circling movement.

The animation is done with only a few animation keyframes, as you can see in the tailwind config above.

Props


PropTypeDefaultDescription

children*

ReactNode-The elements to be circled
radiusnumber100The radius of the circle in pixels
durationnumber10The duration of one complete rotation in seconds
classNamestring-Additional CSS classes for the container

Credits


Inspiration for the demo from Bakken & Bæck