A CSS-animated strip that scrolls its children in a continuous loop. Use it for logo walls, testimonial tickers, or any row of items you want to drift across the page.
Install
pnpm dlx shadcn@latest add https://sitex.full.dev/r/marquee.jsonUsage
import { Marquee } from "@/components/ui/marquee"
export function LogoMarquee() {
return (
<Marquee direction="left" duration={30} gap="3rem" pauseOnHover>
<img src="/logos/acme.svg" alt="Acme" />
<img src="/logos/globex.svg" alt="Globex" />
<img src="/logos/initech.svg" alt="Initech" />
</Marquee>
)
}Key props:
directionsets the scroll axis and heading:"left"(default),"right","top", or"bottom". Vertical directions stack the children in a column.duration(or the legacytimeprop, default30) controls one loop's length; a number is treated as seconds, a string is passed through as a CSS duration.gap(default"1rem") spaces the items and is also used to offset the loop seam.infinite(defaulttrue) duplicates the children in anaria-hiddencopy so the loop is seamless; set it tofalseto animate a single pass without duplication.pauseOnHoverpauses the animation while the pointer is over the marquee, andvariantpicks the edge treatment:"gradient"(default, fades the edges with a mask) or"solid".
The animation is pure CSS (it also respects prefers-reduced-motion), so no client directive is needed. marqueeVariants is exported for reusing the variant classes elsewhere.