Adventureland Registry

Circular Progress

A play/pause button ringed by a GSAP-animated circular progress indicator, sized for carousel autoplay controls.

CircularProgress renders a circular play/pause control with an SVG ring that fills over a given duration. It is the autoplay control used by the media and featured-work carousels, but works standalone for any timed/looping action.

Installation

npx shadcn@latest add @adv/circular-progress

Usage

import { CircularProgress } from '@/components/mediaCarousel/circular-progress';

const [isPlaying, setIsPlaying] = useState(true);

<CircularProgress
  isPlaying={isPlaying}
  showProgress={isPlaying}
  duration={4}
  onToggle={() => setIsPlaying((p) => !p)}
/>

Example

Props

PropTypeDefaultDescription
isPlayingbooleanWhether autoplay is active; toggles the play/pause icon.
onToggle() => voidCalled when the button is clicked.
showProgressbooleanWhether the progress ring is visible and animating.
durationnumberLength of one full ring sweep, in seconds.
classNamestring""Additional CSS classes on the outer wrapper.

On this page