Carousel

Accessible carousel with 5 transition animations, auto-play, and keyboard navigation.

@akex/carousel

Installation

npm install @akex/carousel

Usage

import { Carousel } from "@akex/carousel";

const slides = [
  <div>Slide 1</div>,
  <div>Slide 2</div>,
  <div>Slide 3</div>,
];

<Carousel items={slides} animation="slide" />
<Carousel items={slides} animation="flip" autoPlay interval={3000} />
<Carousel items={slides} animation="elastic" loop={false} />

Live Demo

@akex/carousel

Type-Safe

Built with TypeScript from the ground up for rock-solid DX.

SlideLinear / Vercel

Direction-aware horizontal spring slide with cubic-bezier easing. The bread-and-butter of modern carousels.

Animation Presets

SlideLinear / Vercel

Direction-aware horizontal spring slide with cubic-bezier easing. The bread-and-butter of modern carousels.

animation="slide"
FadeApple / Stripe

Elegant opacity + subtle scale crossfade. Non-directional and refined — lets content breathe.

animation="fade"
ScaleFramer showcase

Current slide zooms out while the incoming slide zooms in. High-drama transitions for product showcases.

animation="scale"
FlipApple product pages

Full 3-D Y-axis rotation with perspective. Bold and cinematic — ideal for card reveals and hero sections.

animation="flip"
ElasticPlayful UIs

Spring physics slide with natural overshoot. Playful and satisfying — great for onboarding flows.

animation="elastic"

Props

PropTypeDefaultDescription
itemsReact.ReactNode[]Array of slide content (required)
animationCarouselAnimation"slide""slide" | "fade" | "scale" | "flip" | "elastic"
autoPlaybooleanfalseAuto-advance slides
intervalnumber4000Auto-play interval in milliseconds
showDotsbooleantrueShow dot navigation indicators
showArrowsbooleantrueShow previous / next arrow buttons
loopbooleantrueLoop back when reaching first or last slide
classNamestringExtra Tailwind classes on the root element