NK

Search

Search pages, posts, and components

All components

Card Marquee

Animation

An infinite marquee of any children, horizontal or vertical.

TypeScriptFlutterNest.jsRust

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/card-marquee.json
Or install manually
  1. 1. Install dependencies

    pnpm add motion clsx tailwind-merge
  2. 2. Copy the component source into components/library/card-marquee.tsx

Props

PropTypeDefaultDescription
childrenReactNode - Content to loop.
verticalbooleanfalseScroll down the y axis instead of across the x axis.
reversebooleanfalseRun the loop in the opposite direction.
pauseOnHoverbooleantruePause the track while the pointer is over it.

Accessibility

  • Duplicated copies are aria-hidden, so the content is announced once.
  • Pauses on hover, so a reader can stop the movement to read.
  • Freezes entirely under prefers-reduced-motion.
  • Copy count is measured, so the loop never leaves a visible gap.

Dependencies

motionclsxtailwind-merge