Marquee
An infinite scrolling component that can be used to display text, images, or videos.
just setting up my twttr
changing status via SMS
Introducing `react-tweet`: ◆ 35x less client-side JavaScript than the Twitter <iframe> ◆ React Server Components for built-in data fetching ◆ Works with Next.js, Vite, CRA, and more vercel.com/blog/introduci…
just setting up my twttr
changing status via SMS
Introducing `react-tweet`: ◆ 35x less client-side JavaScript than the Twitter <iframe> ◆ React Server Components for built-in data fetching ◆ Works with Next.js, Vite, CRA, and more vercel.com/blog/introduci…
just setting up my twttr
changing status via SMS
Introducing `react-tweet`: ◆ 35x less client-side JavaScript than the Twitter <iframe> ◆ React Server Components for built-in data fetching ◆ Works with Next.js, Vite, CRA, and more vercel.com/blog/introduci…
just setting up my twttr
changing status via SMS
Introducing `react-tweet`: ◆ 35x less client-side JavaScript than the Twitter <iframe> ◆ React Server Components for built-in data fetching ◆ Works with Next.js, Vite, CRA, and more vercel.com/blog/introduci…
Marquee
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) => (
<div
key={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>
);
}
module.exports = {
theme: {
extend: {
animation: {
'marquee': 'marquee 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)))' },
},
},
},
},
};
Vertically align marquee
just setting up my twttr
Once you’ve taken a nap with a dog in the middle of the day, how can you continue to believe in capitalism even a little bit
Introducing `react-tweet`: ◆ 35x less client-side JavaScript than the Twitter <iframe> ◆ React Server Components for built-in data fetching ◆ Works with Next.js, Vite, CRA, and more vercel.com/blog/introduci…
just setting up my twttr
Once you’ve taken a nap with a dog in the middle of the day, how can you continue to believe in capitalism even a little bit
Introducing `react-tweet`: ◆ 35x less client-side JavaScript than the Twitter <iframe> ◆ React Server Components for built-in data fetching ◆ Works with Next.js, Vite, CRA, and more vercel.com/blog/introduci…
just setting up my twttr
Once you’ve taken a nap with a dog in the middle of the day, how can you continue to believe in capitalism even a little bit
Introducing `react-tweet`: ◆ 35x less client-side JavaScript than the Twitter <iframe> ◆ React Server Components for built-in data fetching ◆ Works with Next.js, Vite, CRA, and more vercel.com/blog/introduci…
just setting up my twttr
Once you’ve taken a nap with a dog in the middle of the day, how can you continue to believe in capitalism even a little bit
Introducing `react-tweet`: ◆ 35x less client-side JavaScript than the Twitter <iframe> ◆ React Server Components for built-in data fetching ◆ Works with Next.js, Vite, CRA, and more vercel.com/blog/introduci…
Props
Prop | Type | Default |
---|---|---|
reverse | boolean | false |
pauseOnHover | boolean | false |
children | node | - |
vertical | boolean | false |
repeat | number | 1 |