Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Cylinder Carousel

Preview

Drag, scroll or use arrow keys to roll

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/cylinder-carousel

Import the shared styles once in your application.

TSUsage
import CylinderCarousel from '@/components/beui/layout/CylinderCarousel.vue'
import '@/components/beui/styles.css'

API Reference

itemSize?
number

Max item box size in px (square) at full size. Balls shrink below this in narrow containers.

Default200
visibleItems?
number

How many item slots span the container width.

Default5
variant?
"concave" | "convex"

"concave": inside of the cylinder; "convex": outside of it.

Defaultconcave
minScale?
number

Scale of the smallest ball.

Default0.55
dragSpeed?
number

Items rolled per item-width dragged.

Default1.5
arc?
number

Curve depth in px. Defaults to 35% of the item size.

Default—
snap?
boolean

Snap to the nearest item when the roll settles.

Defaulttrue
autoRotate?
boolean

Roll on its own until interacted with.

Defaultfalse
autoRotateSpeed?
number

Auto-roll speed in items per second.

Default0.4
defaultIndex?
number
Default0
@index-change?
(index: number) => void
Default—
height?
number

Stage height in px. Defaults to the fitted item size.

Default—
labels?
Partial<CylinderCarouselMessages>

Override any built-in string.

Default—
class?
string
Default—
items
readonly Item[]
Default—
label?
string
Default—
#default?
slot
Default—

Updated