Marquees

Component that supports infinite scrolling, allowing for the seamless display of text, images, or videos

Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jane

@jane

I'm at a loss for words. This is amazing. I love it.
Jenny

@jenny

I'm at a loss for words. This is amazing. I love it.
James

@james

I'm at a loss for words. This is amazing. I love it.
Jane

@jane

I'm at a loss for words. This is amazing. I love it.
Jenny

@jenny

I'm at a loss for words. This is amazing. I love it.
James

@james

I'm at a loss for words. This is amazing. I love it.
Jane

@jane

I'm at a loss for words. This is amazing. I love it.
Jenny

@jenny

I'm at a loss for words. This is amazing. I love it.
James

@james

I'm at a loss for words. This is amazing. I love it.
Jane

@jane

I'm at a loss for words. This is amazing. I love it.
Jenny

@jenny

I'm at a loss for words. This is amazing. I love it.
James

@james

I'm at a loss for words. This is amazing. I love it.

Usage

tailwind.config.ts
module.exports = {
theme: {
extend: {
animation: {
marquee: 'marquee var(--duration) linear infinite',
'marquee-vertical': 'marquee-vertical var(--duration) linear infinite',
},
keyframes: {
marquee: {
from: { transform: 'translateX(0)' },
to: { transform: 'translateX(calc(-100% - var(--gap)))' },
},
'marquee-vertical': {
from: { transform: 'translateY(0)' },
to: { transform: 'translateY(calc(-100% - var(--gap)))' },
},
},
},
},
};
marquee.tsx
1
import { cn } from '@/lib/utils';
2
3
interface MarqueeProps {
4
className?: string;
5
reverse?: boolean;
6
pauseOnHover?: boolean;
7
children?: React.ReactNode;
8
vertical?: boolean;
9
repeat?: number;
10
[key: string]: any;
11
}
12
13
export default function Marquee({
14
className,
15
reverse,
16
pauseOnHover = false,
17
children,
18
vertical = false,
19
repeat = 4,
20
...props
21
}: MarqueeProps) {
22
return (
23
<div
24
{...props}
25
className={cn(
26
'group flex overflow-hidden p-2 [--duration:40s] [--gap:1rem] [gap:var(--gap)]',
27
{
28
'flex-row': !vertical,
29
'flex-col': vertical,
30
},
31
className
32
)}
33
>
34
{Array(repeat)
35
.fill(0)
36
.map((_, i) => (
37
<div
38
key={i}
39
className={cn('flex shrink-0 justify-around [gap:var(--gap)]', {
40
'animate-marquee flex-row': !vertical,
41
'animate-marquee-vertical flex-col': vertical,
42
'group-hover:[animation-play-state:paused]': pauseOnHover,
43
'[animation-direction:reverse]': reverse,
44
})}
45
>
46
{children}
47
</div>
48
))}
49
</div>
50
);
51
}

Exammple

Varticle Maruqee

Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.

Logos Maruqee

Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jack

@jack

I've never seen anything like this before. It's amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.
Jill

@jill

I don't know what to say. I'm speechless. This is amazing.
John

@john

I'm at a loss for words. This is amazing. I love it.

3D Maruqee

MicrosoftAppleGoogleFacebookLinkedInTwitter
MicrosoftAppleGoogleFacebookLinkedInTwitter
MicrosoftAppleGoogleFacebookLinkedInTwitter
MicrosoftAppleGoogleFacebookLinkedInTwitter