← All components
Interaction / component

Carousel

A tactile card carousel with perspective rotation, spring motion and a circular variant.

PLAYGROUND
Live preview
Preparing preview…

Take it with you.

SOURCE ACCESS

Preview freely. Unlock the files.

Enter the shared password to copy the complete source, download every file, and install components in your app.

Access lasts 24 hours. Your preview settings stay with you.

Component notes

  • Import Carousel.tsx for the control or Demo.tsx for the complete gallery composition. The gallery uses width 340, looping and hover pause; reusable defaults are width 300, no looping and no hover pause.
  • Drag horizontally, use the previous/next buttons or focus the region and press ArrowLeft, ArrowRight, Home or End. Tiny pointer movements do not navigate. Inactive cards and wrap clones are inert and hidden from assistive technology.
  • The original perspective, 300/30 spring, 16px spacing, radii, icons and circular variant are retained. Explicit arrows add a navigation row. The gallery starts its width range at 280px so the supplied circular content stays readable. Custom smaller circles need shorter content and fewer slides.
  • Autoplay pauses while focus is inside, and optionally while hovered. Explicit pause preserves remaining time; hidden and offscreen time is excluded. Reduced motion renders a static slide with immediate navigation. Idle non-autoplay and completed nonloop slides request no frames.
  • Changing item identities, loop mode or replayToken resets selection to the first slide. Width is constrained by the embedding container. Delay is bounded to 250–60000ms; up to 100 slides are rendered.
React 19.2ResizeObserver

React Bits · MIT with Commons Clause. Used with explicit project permission; see bundled notice.

Props

PropTypeDefaultDescription
baseWidthnumber300Width
autoplaybooleanfalseAutoplay
autoplayDelaynumber3000Autoplay interval
pauseOnHoverbooleanfalsePause on hover
loopbooleanfalseLoop
roundbooleanfalseCircular cards
itemsCarouselItem[]five example slidesUnique id, title, description and optional ReactNode icon. Up to 100 items; structural identity changes reset selection.
onIndexChange(index: number) => voidundefinedCalled when the zero-based logical selection changes.
pausedbooleanfalseDisable decorative motion; interaction remains functional.
replayTokennumber0Change to reset internal state.
classNamestring''Additional outer classes.