asafefe.dev

Marquee

An infinite scrolling row with edge fade, direction, and pause on hover.

utils
ReactNext.jsTypeScriptMotionTailwindNodePostgres

Installation

$ pnpm dlx shadcn@latest add @soultel/marquee

No namespace set up? npx shadcn@latest add https://asafefe.dev/r/marquee.json works too.

Manual installation
  1. 1. Copy the source from the Code tab into components/marquee.tsx.
  2. 2. Add the keyframes it uses (marquee) to your global CSS. The CLI does this for you.

Usage

example.tsx11 lines
import { Marquee } from "@/components/marquee"

export function Example() {
  return (
    <Marquee>
      <span>React</span>
      <span>Next.js</span>
      <span>TypeScript</span>
    </Marquee>
  )
}

Props

PropTypeDefaultDescription
speednumber30Seconds per loop.
reversebooleanfalseScroll the other way.
pauseOnHoverbooleantruePause while hovered.
fadebooleantrueMask the edges.