Marquee

Previous

Renders a looping marquee animation with horizontal or vertical scrolling. Supports adjustable speed, direction, repeat count, and pause on hover.

marquee-default

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

PropTypeDefaultDescription
classNamestringOptional CSS class name to apply custom styles
reversebooleanfalseWhether to reverse the animation direction
pauseOnHoverbooleanfalseWhether the animation pauses when hovered
childrenReact.ReactNodeContent to be displayed in the marquee
verticalbooleanfalseWhether to animate vertically instead of horizontally
repeatnumber5Number of times to repeat the content
speed"slow" | "normal" | "fast""normal"Animation speed variant