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)));
}
}
}
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>
)
}
Content to display in the marquee
Reverse the animation direction
Pause animation when hovering over the component
Display marquee vertically instead of horizontally
Number of times to repeat the content
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