Skip to Content
archive
Components

Draggable

A horizontal scroll container that can be scrolled by dragging with a mouse or touch.

Draggable is a horizontal scroll container. Drag the content left or right with a mouse, pen, or touch to scroll it. Native scrolling with a trackpad, mouse wheel, or scrollbar still works.

Installation

bunx --bun shadcn@latest add https://docs.danpoj.site/r/draggable.json

Running the command above installs the draggable component into your project. It also uses the cn helper from @/lib/utils, which the shadcn CLI adds if your project doesn't have it yet.

Examples

Pine Tree

A lone pine on a misty cliff.

Mist Field

Soft fog over an open field.

Lake Dawn

Pale pink sky reflected on water.

Hill Valley

Rolling green hills in the valley.

Coast Rocks

Rugged rocks along the shoreline.

Sunset Clouds

Warm clouds glowing at sunset.

Green Forest

Dense forest under a calm sky.

Misty Peak

A mountain peak wrapped in mist.

Quiet Lake

A still lake at the water's edge.

반가운 오리졸린 고양이달콤한 수박푸른 바다조용한 숲빨간 우산행복한 강아지시원한 바람노란 병아리반짝이는 별따뜻한 커피하얀 구름신나는 토끼작은 돌멩이말랑한 찹쌀떡긴 기차길초록 개구리멋진 사자달리는 자전거포근한 이불커다란 고래새콤한 딸기엉뚱한 펭귄바삭한 과자높은 산봉우리수줍은 다람쥐차가운 아이스크림재밌는 책방깊은 우물고소한 팝콘즐거운 소풍

Props

PropTypeDescription
childrenReactNodeThe items to scroll horizontally.
classNamestringExtra classes merged with the default styles. Use it for gap, padding, and so on.
...propsComponentProps<'div'>Any other div attributes are passed to the root element.

Last updated on

On this page