Marquee
Renders a looping marquee animation with horizontal or vertical scrolling. Supports adjustable speed, direction, repeat count, and pause on hover.
marquee-default
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
ReactNext.jsTypeScriptTailwind CSSFramer MotionRadix UILucide Iconsshadcn/ui
import { Badge } from "@/components/ui/badge"
import { Marquee } from "@/components/ui/common/marquee"
const technologies = [
{ name: "React", color: "bg-blue-500" },
{ name: "Next.js", color: "bg-black" },
{ name: "TypeScript", color: "bg-blue-600" },
{ name: "Tailwind CSS", color: "bg-cyan-500" },
{ name: "Framer Motion", color: "bg-pink-500" },
{ name: "Radix UI", color: "bg-green-500" },
{ name: "Lucide Icons", color: "bg-orange-500" },
{ name: "shadcn/ui", color: "bg-purple-500" },
]
export function DemoOne() {
return (
<div className="relative flex h-full items-center justify-center overflow-hidden rounded-xl border">
<main className="">
<Marquee>
{technologies.map((tech, index) => (
<Badge
key={index}
className={`${tech.color} rounded-md px-4 py-2 text-sm font-medium text-white`}
>
{tech.name}
</Badge>
))}
</Marquee>
<Marquee reverse>
{technologies.map((tech, index) => (
<Badge
key={index}
className={`${tech.color} rounded-md px-4 py-2 text-white`}
>
{tech.name}
</Badge>
))}
</Marquee>
<Marquee speed="slow">
{technologies.map((tech, index) => (
<Badge
key={index}
className={`${tech.color} rounded-md px-4 py-2 text-white`}
>
{tech.name}
</Badge>
))}
</Marquee>
<Marquee reverse speed="fast">
{technologies.map((tech, index) => (
<Badge
key={index}
className={`${tech.color} rounded-md px-4 py-2 text-white`}
>
{tech.name}
</Badge>
))}
</Marquee>
</main>
</div>
)
}
pnpm dlx shadcn@latest add "https://ui.dalim.in/r/marquee-default.json"
Installation
pnpm dlx shadcn@latest add https://ui.dalim.in/r/styles/default/marquee.json
Usage
import { Marquee } from "@/components/marquee"
<Marquee speed="fast" pauseOnHover className="bg-gray-900 p-2 text-white">
<span className="px-4">🚀 Fast</span>
<span className="px-4">🔥 Scrolling</span>
<span className="px-4">🌈 Marquee</span>
</Marquee>
CSS
@import "tailwindcss";
@import "tw-animate-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)));
}
}
API Reference
Marquees
Prop | Type | Default | Description |
---|---|---|---|
className | string | – | Optional CSS class name to apply custom styles |
reverse | boolean | false | Whether to reverse the animation direction |
pauseOnHover | boolean | false | Whether the animation pauses when hovered |
children | React.ReactNode | – | Content to be displayed in the marquee |
vertical | boolean | false | Whether to animate vertically instead of horizontally |
repeat | number | 5 | Number of times to repeat the content |
speed | "slow" | "normal" | "fast" | "normal" | Animation speed variant |