Pluto UIpluto/ui
Components

Pattern Carousel

An interactive carousel component with multiple animation patterns including circle, wave, stagger, grid, fan, and 3D depth.

// Code for pattern-carousel/basic

Installation

Loading installation instructions...

Usage

import { PatternCarousel } from "@/components/pluto-ui/pattern-carousel"
import type { PatternType } from "@/components/pluto-ui/pattern-carousel"
import { useState } from "react"

const items = [
  { id: "1", image: "https://example.com/image1.jpg", number: 1 },
  { id: "2", image: "https://example.com/image2.jpg", number: 2 },
]

function MyCarousel() {
  const [pattern, setPattern] = useState<PatternType>("circle")

  return (
    <PatternCarousel
      items={items}
      pattern={pattern}
      onPatternChange={setPattern}
    />
  )
}

Props

Prop

Type

Patterns

The carousel supports six different animation patterns:

  • Circle: Cards arranged in a circle, draggable to rotate
  • Wave: Cards arranged in a wave pattern with continuous animation
  • Stagger: Cards arranged in a staggered grid with mouse parallax
  • Grid: Cards arranged in a responsive grid layout
  • Fan: Cards arranged in a fan pattern, draggable to rotate
  • 3D Depth: Cards arranged in 3D space with mouse parallax

Examples

Wave Pattern

// Code for pattern-carousel/basic

Grid Pattern

// Code for pattern-carousel/custom-content

Fan Pattern

// Code for pattern-carousel/minimal

Stagger Pattern

// Code for pattern-carousel/stagger

3D Depth Pattern

// Code for pattern-carousel/depth

Type Definitions

export type PatternType =
  | "circle"
  | "wave"
  | "stagger"
  | "grid"
  | "fan"
  | "depth"

export interface PatternCarouselItem {
  id: string
  image: string
  number?: number
}

export interface PatternCarouselProps {
  items: PatternCarouselItem[]
  pattern?: PatternType
  onPatternChange?: (pattern: PatternType) => void
  wheelRadius?: number
  cardWidth?: number
  cardHeight?: number
  className?: string
  children?: React.ReactNode
}

Credits

This component was inspired by the Filip Zrnzevic CSS view-timeline shine effect demonstrations.