Marquee
magicui/marqueeFreeComponent
An infinite scrolling component that can be used to display text, images, or videos.
Live preview
live · rendered by the registry
Rendered by magicui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://magicui.design/r/marquee.jsonSource
1import { type ComponentPropsWithoutRef } from "react"23import { cn } from "@/lib/utils"45interface MarqueeProps extends ComponentPropsWithoutRef<"div"> {6 /**7 * Optional CSS class name to apply custom styles8 */9 className?: string10 /**11 * Whether to reverse the animation direction12 * @default false13 */14 reverse?: boolean15 /**16 * Whether to pause the animation on hover17 * @default false18 */19 pauseOnHover?: boolean20 /**21 * Content to be displayed in the marquee22 */23 children: React.ReactNode24 /**25 * Whether to animate vertically instead of horizontally26 * @default false27 */28 vertical?: boolean29 /**30 * Number of times to repeat the content31 * @default 432 */33 repeat?: number34}3536export function Marquee({37 className,38 reverse = false,39 pauseOnHover = false,40 children,41 vertical = false,42 repeat = 4,43 ...props44}: MarqueeProps) {45 return (46 <div47 {...props}48 className={cn(49 "group flex gap-(--gap) overflow-hidden p-2 [--duration:40s] [--gap:1rem]",50 {51 "flex-row": !vertical,52 "flex-col": vertical,53 },54 className55 )}56 >57 {Array(repeat)58 .fill(0)59 .map((_, i) => (60 <div61 key={i}62 className={cn("flex shrink-0 justify-around gap-(--gap)", {63 "animate-marquee flex-row": !vertical,64 "animate-marquee-vertical flex-col": vertical,65 "group-hover:[animation-play-state:paused]": pauseOnHover,66 "[animation-direction:reverse]": reverse,67 })}68 >69 {children}70 </div>71 ))}72 </div>73 )74}
Files it writes
More from magicui
All 247 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Androidandroid | magicui | Components | Free | no deps | |
| Animated Beamanimated-beam | magicui | Components | Free | 1 dep | |
| Animated Circular Progress Baranimated-circular-progress-bar | magicui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | magicui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | magicui | Components | Free | 1 dep | |
| Animated Listanimated-list | magicui | Components | Free | 1 dep | |
| Animated Shiny Textanimated-shiny-text | magicui | Components | Free | no deps | |
| Theme Toggleranimated-theme-toggler | magicui | Components | Free | 1 dep |
