alexander-rukin

Carousel

Galleries 15

About

A swipeable, theme-aware image/slide carousel with prev/next arrows, dot indicators and keyboard arrow-key navigation.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Carousel to your project and fits it to your theme.

Code

How Carousel is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { Carousel } from "@/components/ui/carousel";

const CAROUSEL_SLIDES = [
  { bg: "#2F6FE0", label: "Slide 1" },
  { bg: "#7A5FC0", label: "Slide 2" },
  { bg: "#2FA855", label: "Slide 3" },
  { bg: "#FF9F0A", label: "Slide 4" },
];

export default function CarouselDemo() {
  return (
    <div
      style={{
        width: "100%",
        maxWidth: 460,
        padding: 16,
        boxSizing: "border-box",
      }}
    >
      <Carousel
        height={240}
        slides={CAROUSEL_SLIDES.map((s) => (
          <div
            key={s.label}
            style={{
              width: "100%",
              height: "100%",
              display: "flex",
              alignItems: "center",
              justifyContent: "center",
              background: s.bg,
              color: "#fff",
              fontSize: 22,
              fontWeight: 800,
            }}
          >
            {s.label}
          </div>
        ))}
      />
    </div>
  );
}

More by alexander-rukin

View all
  • Combobox

    Combobox

  • Textarea

    Textarea

  • Tooltip

    Tooltip

  • Card

    Card

  • Range Slider

    Range Slider

  • Input

    Input

  • Date Picker

    Date Picker

More in Galleries

View all
  • Scattered About

    Scattered About

    14
  • Animated Gallery

    Animated Gallery

    1.5K
  • Photo Deck

    Photo Deck

    4
  • Gallery Component

    Gallery Component

    5
  • Editorial Collage Hero

    Editorial Collage Hero

    507
  • Elastic Gallery

    Elastic Gallery

    1.1K
  • Image Gallery

    Image Gallery

    130
  • Folded Card

    Folded Card

    42