Stylish Carousel

A cinematic fan-out of images with spring physics. Pass items or use the bundled demos. Built with motion.

Default

Slides fan with rotate + scale. Arrows, dots, click-to-jump, keyboard, and swipe. Spring-tuned motion.

Loading…

Installation

CLI
npx @sonojs/ui@latest add stylish-carousel
Also needsnpm i lucide-react motion

Usage

Demo images install under components/carousels/stylish-carousel/images/. Pass your own items when you replace them.

page.tsx
"use client"

import { StylishCarousel } from "@/components/carousels/stylish-carousel"

export default function Page() {
  return (
    <StylishCarousel
      initialIndex={3}
      showArrows
      showDots
      clickToNavigate
      slideSize="clamp(200px, 40vw, 420px)"
    />
  )
}

Props

PropTypeDefaultDescription
itemsStylishCarouselItem[]bundled imagesSlides with `src` and optional `title` / `alt`. Defaults to static imports from `./images/`.
initialIndexnumber0Starting active slide (0-based).
slideSizestringclamp(...)CSS size for each square slide.
rotationDegreesnumber28Rotate degrees per offset from center.
inactiveScalenumber0.62Scale of non-active slides.
autoPlaynumber0Auto-advance interval in ms. `0` disables.
showArrowsbooleantruePrev / next controls.
showDotsbooleantrueDot indicators.
clickToNavigatebooleantrueClick an inactive slide to jump to it.
onIndexChange(index: number) => void-Fires when the active index changes.
classNamestring-Extra classes on the root.