Command Palette

Search for a command to run...

Docs
Rainbow Carousel

Rainbow Carousel

A continuously rotating rainbow-arc carousel with autoplay. Cards fan out from center with tilt — accepts any content.

City 1
City 2
City 3
City 4
City 5
City 6
City 7
City 8

Installation

Usage

import { RainbowCarousel } from "@/components/motionx/rainbow-carousel";
 
const images = [
  "https://images.unsplash.com/photo-1480714378408-67cf0d13bc1b?w=400&h=500&fit=crop",
  "https://images.unsplash.com/photo-1449824913935-59a10b8d2000?w=400&h=500&fit=crop",
  "https://images.unsplash.com/photo-1444723121867-7a241cacace9?w=400&h=500&fit=crop",
];
 
export default function App() {
  return (
    <RainbowCarousel
      items={images.map((src, i) => ({
        id: String(i),
        content: (
          <img
            src={src}
            alt={`Image ${i + 1}`}
            className="h-full w-full rounded-2xl object-cover shadow-xl"
          />
        ),
      }))}
      cycleDuration={10}
      pauseOnHover
    />
  );
}

Props

PropTypeDefaultDescription
itemsRainbowCarouselItem[]requiredArray of items with id and content (ReactNode)
cycleDurationnumber8Seconds for one full cycle
pauseOnHoverbooleantruePause rotation when hovered
maxTiltnumber25Maximum tilt angle (degrees) for outermost cards
spreadnumber1Horizontal spread factor — increase for wider arc
cardClassNamestring-Additional className for each card wrapper
classNamestring-Additional className for the root container
heightstring"500px"Container height