Back to Shark UI

Marquee

docs/components/marquee

latest7.3 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Marquee

Copy Markdown

Scrolls items in a horizontal container.

DocsAPI

PreviewCode

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/marquee

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#

PreviewCode

Vertical#

PreviewCode

Examples#

Pause on hover#

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

PreviewCode

Reverse#

Use the reverse prop to scroll in the opposite direction.

PreviewCode

Auto fill#

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

PreviewCode

Spacing#

Use the spacing prop to control the gap between items.

PreviewCode

Fade#

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

PreviewCode

Custom speed#

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

PreviewCode

API Reference#

Marquee#

Root component. Manages the scrolling viewport and animation.

PropTypeDefault
orientation`"horizontal""vertical"`
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.

[

Previous page

Listbox ](/docs/components/listbox)[

Next page

Menu ](/docs/components/menu)

On This Page

InstallationAnatomyUsageOrientationHorizontalVerticalExamplesPause on hoverReverseAuto fillSpacingFadeCustom speedAPI ReferenceMarqueeMarqueeContentMarqueeItem