Cylinder Carousel
Cylinder Carousel positions children along a curved strip and exposes the selected index.
Practical React example
Browse a small visual collection without depending on automatic rotation.
Before you copy and paste
Keep the example in the React rendering environment required by the imported component. Copy components/motion/cylinder-carousel.tsx and its returned support files from the Code tab; preserve the project-relative paths.
Listed package dependencies: @paper-design/shaders-react, clsx, motion, react, tailwind-merge.
Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.
Browse a small visual collection without depending on automatic rotation
// Usage adapted from beUI's pinned MIT source.
// Copyright (c) 2026 Saurabh Chauhan. See ./LICENSES.md.
"use client";
import { type ComponentType, useState } from "react";
import { CylinderCarousel } from "@/components/motion/cylinder-carousel";
import {
ShaderBackground,
type ShaderBackgroundVariant,
} from "@/components/motion/shader-background";
import { Tabs, TabsList, TabsTrigger } from "@/components/motion/tabs";
// Each variant has its own prop shape; the slides only spread their own preset.
const Background = ShaderBackground as ComponentType<
{ variant: ShaderBackgroundVariant; className?: string } & Record<
string,
unknown
>
>;
const SLIDES: { variant: ShaderBackgroundVariant; props: Record<string, unknown> }[] = [
{
variant: "dithering",
props: { colorBack: "#1a1030", colorFront: "#b98cff", speed: 0.3 },
},
{
variant: "metaballs",
props: { colors: ["#e8e8ef", "#8a8a9a", "#1a1a22"], colorBack: "#c9b9a8", speed: 0.4 },
},
{
variant: "warp",
props: { colors: ["#c8ff00", "#3a5a00", "#c8ff00", "#88bb00"], speed: 0.4 },
},
{
variant: "god-rays",
props: { colors: ["#6a7bff", "#00114d"], colorBack: "#000000", speed: 0.5 },
},
{
variant: "swirl",
props: { colorBack: "#1a0000", colors: ["#ffd1a8", "#ff6a3d", "#b31a57"], speed: 0.3 },
},
{
variant: "mesh-gradient",
props: { colors: ["#e0eaff", "#241d9a", "#f75092", "#9f50d3"], speed: 0.3 },
},
{
variant: "voronoi",
props: { colors: ["#ff8247", "#ffe53d"], speed: 0.3 },
},
{
variant: "neuro-noise",
props: { colorFront: "#ffffff", colorMid: "#47a6ff", colorBack: "#000000", speed: 0.4 },
},
];
export function CylinderCarouselPreview() {
const [variant, setVariant] = useState<"concave" | "convex">("concave");
return (
<div className="flex w-full flex-col items-center gap-4 p-6">
<Tabs
value={variant}
onValueChange={(v) => setVariant(v as "concave" | "convex")}
variant="segment"
>
<TabsList>
<TabsTrigger value="concave">Concave</TabsTrigger>
<TabsTrigger value="convex">Convex</TabsTrigger>
</TabsList>
</Tabs>
{/* clip-path (not overflow) so the rounded corner also clips the GPU-composited balls */}
<div className="w-full rounded-3xl border border-border/60 bg-muted/20 py-6 [clip-path:inset(0_round_1.5rem)]">
<CylinderCarousel
variant={variant}
itemSize={230}
height={310}
className="w-full"
>
{SLIDES.map((slide) => (
<div
key={slide.variant}
className="h-full w-full overflow-hidden rounded-full border border-border/40"
>
<Background
variant={slide.variant}
className="h-full w-full"
{...slide.props}
/>
</div>
))}
</CylinderCarousel>
</div>
<p className="text-xs text-muted-foreground">
Drag, scroll or use arrow keys to roll
</p>
</div>
);
}
Usage example adapted from beUI's pinned MIT source. Retain the source licence notices when copying.
Give items useful text or descriptions and keep navigation available outside the drag gesture. Start with autoRotate disabled when the content needs to be read.
Customization
- CylinderCarouselProps.children
- Required; ReactNode.
- CylinderCarouselProps.itemSize
- Optional; number. Max item box size in px (square) at full size, i.e. at the container edge. Balls shrink below this automatically so the row keeps breathing room in narrow containers.
- CylinderCarouselProps.visibleItems
- Optional; number. How many item slots span the container width.
- CylinderCarouselProps.variant
- Optional; "concave" | "convex". "concave" (default): inside of the cylinder — center ball smallest and dipped, growing toward the edges. "convex": outside of the cylinder — center ball biggest and raised, shrinking toward the edges.
- CylinderCarouselProps.minScale
- Optional; number. Scale of the smallest ball (center for concave, edges for convex); the biggest reaches 1.
- CylinderCarouselProps.dragSpeed
- Optional; number. Items rolled per item-width dragged — above 1 the wall outruns the pointer, which reads as a lighter, freer roll.
- CylinderCarouselProps.arc
- Optional; number. Curve depth in px: for concave, how far the edge balls ride above the center one (valley); for convex, how far below (arch). 0 = flat line. Defaults to 35% of the item size.
- CylinderCarouselProps.snap
- Optional; boolean. Snap to the nearest item when the roll settles.
- CylinderCarouselProps.autoRotate
- Optional; boolean. Roll on its own until interacted with.
- CylinderCarouselProps.autoRotateSpeed
- Optional; number. Auto-roll speed in items per second.
- CylinderCarouselProps.defaultIndex
- Optional; number.
- CylinderCarouselProps.onIndexChange
- Optional; (index: number) => void.
- CylinderCarouselProps.height
- Optional; number. Stage height in px. Defaults to `itemSize`.
- CylinderCarouselProps.className
- Optional; string.
Integration notes
- A visual index is not a stable record ID; map it to your own item data.
- Test long labels, touch drag, reduced motion and a non-drag navigation alternative.
Component source: beUI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.
Give your agent taste.
The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.
All components are free. Sign up only to connect MCP.