Skip to content
shadcn.io is not affiliated with official shadcn/ui

Shadcn Marquee for React and Tailwind

Scrolls items in a horizontal container.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/marquee.json

Anatomy

Marquee
├── MarqueeContent
    └── MarqueeItem

Usage

import { 
  Marquee, 
  MarqueeContent, 
  MarqueeItem,
} from "@/components/ui/marquee";
<Marquee>
  <MarqueeContent>
    <MarqueeItem />
    <MarqueeItem />
    <MarqueeItem />
  </MarqueeContent>
</Marquee>

Orientation

Use the orientation prop to control the orientation of the marquee.

Horizontal

Vertical

Examples

Pause on hover

Use the pauseOnInteraction prop to pause the marquee on hover or focus.

Reverse

Use the reverse prop to scroll in the opposite direction.

Auto fill

Use the autoFill prop to automatically duplicate content to fill the container.

Spacing

Use the spacing prop to control the gap between items.

Fade

Use the showEdges prop to show or hide the gradient fade at the start and end of the marquee.

Custom speed

Use the speed prop (pixels per second) to control scroll speed.

API Reference

Marquee

Root component. Manages the scrolling viewport and animation.

PropTypeDefault
orientation"horizontal" | "vertical""horizontal"
speednumber50
spacingstring"16px"
showEdgesbooleantrue
autoFillbooleanfalse
pauseOnInteractionbooleanfalse
reversebooleanfalse
classNamestring-

MarqueeContent

Viewport wrapper. Wrap MarqueeItem children with this. Animates content horizontally.

PropTypeDefault
classNamestring-
asChildboolean-

MarqueeItem

Single item in the scrolling marquee.

PropTypeDefault
classNamestring-
asChildboolean-

For a complete list of props, see the Ark UI documentation.