Marquee Component
A customizable Marquee component with animation, direction control, pause on hover, and repeat options. Ideal for creating smooth, dynamic UI elements in React.
A customizable Marquee component with animation, direction control, pause on hover, and repeat options. Ideal for creating smooth, dynamic UI elements in React.
@jack
I've never seen anything like this before. It's amazing. I love it.
@jill
I don't know what to say. I'm speechless. This is amazing.
@john
I'm at a loss for words. This is amazing. I love it.
@jack
I've never seen anything like this before. It's amazing. I love it.
@jill
I don't know what to say. I'm speechless. This is amazing.
@john
I'm at a loss for words. This is amazing. I love it.
@jack
I've never seen anything like this before. It's amazing. I love it.
@jill
I don't know what to say. I'm speechless. This is amazing.
@john
I'm at a loss for words. This is amazing. I love it.
@jack
I've never seen anything like this before. It's amazing. I love it.
@jill
I don't know what to say. I'm speechless. This is amazing.
@john
I'm at a loss for words. This is amazing. I love it.
@jane
I'm at a loss for words. This is amazing. I love it.
@jenny
I'm at a loss for words. This is amazing. I love it.
@james
I'm at a loss for words. This is amazing. I love it.
@jane
I'm at a loss for words. This is amazing. I love it.
@jenny
I'm at a loss for words. This is amazing. I love it.
@james
I'm at a loss for words. This is amazing. I love it.
@jane
I'm at a loss for words. This is amazing. I love it.
@jenny
I'm at a loss for words. This is amazing. I love it.
@james
I'm at a loss for words. This is amazing. I love it.
@jane
I'm at a loss for words. This is amazing. I love it.
@jenny
I'm at a loss for words. This is amazing. I love it.
@james
I'm at a loss for words. This is amazing. I love it.
@jack
I've never seen anything like this before. It's amazing. I love it.
@jack
I've never seen anything like this before. It's amazing. I love it.
@jack
I've never seen anything like this before. It's amazing. I love it.
@jack
I've never seen anything like this before. It's amazing. I love it.
@jill
I don't know what to say. I'm speechless. This is amazing.
@john
I'm at a loss for words. This is amazing. I love it.
@jill
I don't know what to say. I'm speechless. This is amazing.
@john
I'm at a loss for words. This is amazing. I love it.
@jill
I don't know what to say. I'm speechless. This is amazing.
@john
I'm at a loss for words. This is amazing. I love it.
@jill
I don't know what to say. I'm speechless. This is amazing.
@john
I'm at a loss for words. This is amazing. I love it.
import { cn } from "@/lib/utils";interface MarqueeProps {className?: string;reverse?: boolean;pauseOnHover?: boolean;children?: React.ReactNode;vertical?: boolean;repeat?: number;[key: string]: any;}export default function Marquee({className,reverse,pauseOnHover = false,children,vertical = false,repeat = 4,...props}: MarqueeProps) {return (<div{...props}className={cn("group flex overflow-hidden p-2 [--duration:40s] [--gap:1rem] [gap:var(--gap)]",{"flex-row": !vertical,"flex-col": vertical,},className,)}>{Array(repeat).fill(0).map((_, i) => (<divkey={i}className={cn("flex shrink-0 justify-around [gap:var(--gap)]", {"animate-marquee flex-row": !vertical,"animate-marquee-vertical flex-col": vertical,"group-hover:[animation-play-state:paused]": pauseOnHover,"[animation-direction:reverse]": reverse,})}>{children}</div>))}</div>);}
Marquee
Prop | Type | Default | Description |
---|---|---|---|
className | string | undefined | Optional CSS class for styling the main marquee container. |
reverse | boolean | false | Determines if the marquee animation should play in reverse. |
pauseOnHover | boolean | false | Pauses the marquee animation when hovered. |
children | React.ReactNode | undefined | The content to display within the marquee animation. |
vertical | boolean | false | Controls the direction of the marquee; if true, the marquee scrolls vertically instead of horizontally. |
repeat | number | 4 | Specifies the number of times the content should repeat within the marquee. |