Skip to main content
Create smooth infinite scrolling animations for logos, testimonials, images, and more.

Installation

npx shadcn@latest add @magicui/marquee

Required CSS

Add these animations to your global CSS:
@theme inline {
  --animate-marquee: marquee var(--duration) infinite linear;
  --animate-marquee-vertical: marquee-vertical var(--duration) linear infinite;

  @keyframes marquee {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(calc(-100% - var(--gap)));
    }
  }
  @keyframes marquee-vertical {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(calc(-100% - var(--gap)));
    }
  }
}

Usage

import { Marquee } from "@/components/ui/marquee"

export default function Example() {
  return (
    <Marquee>
      <span>Next.js</span>
      <span>React</span>
      <span>TypeScript</span>
      <span>Tailwind CSS</span>
    </Marquee>
  )
}

Props

children
React.ReactNode
required
Content to display in the marquee
reverse
boolean
default:"false"
Reverse the animation direction
pauseOnHover
boolean
default:"false"
Pause animation when hovering over the component
vertical
boolean
default:"false"
Display marquee vertically instead of horizontally
repeat
number
default:"4"
Number of times to repeat the content
className
string
Additional CSS classes to apply

Examples

Vertical Marquee

Set vertical={true} for vertical scrolling.

3D Effect

Combine with transform utilities for 3D effects.

Features

  • Smooth infinite scrolling
  • Horizontal or vertical direction
  • Pause on hover
  • Customizable speed via CSS variables
  • Responsive and performant

Build docs developers (and LLMs) love