Cylinder Carousel

A carousel whose items line the inside of a cylinder, receding into the center and growing toward the edges. Drag, scroll or arrow-key to roll it, with a springy glide and snap. Reduced-motion drops the glide.

Preview

Drag, scroll or use arrow keys to roll

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/cylinder-carousel

API Reference

itemSize?
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.

200
visibleItems?
number

How many item slots span the container width.

5
variant?
"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.

concave
minScale?
number

Scale of the smallest ball (center for concave, edges for convex); the biggest reaches 1.

0.55
dragSpeed?
number

Items rolled per item-width dragged — above 1 the wall outruns the pointer, which reads as a lighter, freer roll.

1.5
arc?
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.

snap?
boolean

Snap to the nearest item when the roll settles.

true
autoRotate?
boolean

Roll on its own until interacted with.

false
autoRotateSpeed?
number

Auto-roll speed in items per second.

0.4
defaultIndex?
number
0
onIndexChange?
((index: number) => void)
height?
number

Stage height in px. Defaults to `itemSize`.

className?
string

Updated