BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/wise-ui/marquee

Marquee

wise-ui/marquee
FreeComponent

An infinite scrolling marquee with configurable speed and direction.

Live preview

live · rendered by the registry
Rendered by wise-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://wise-ui.com/r/marquee.json

Source

registry/wise-ui/components/marquee.tsxwise-ui.com/r/marquee.json
1"use client"
2
3import * as React from "react"
4import { cn } from "@/registry/wise-ui/lib/utils"
5
6interface MarqueeProps {
7 speed?: number
8 direction?: "left" | "right"
9 pauseOnHover?: boolean
10 children: React.ReactNode
11 className?: string
12}
13
14function Marquee({
15 speed = 40,
16 direction = "left",
17 pauseOnHover = false,
18 children,
19 className,
20}: MarqueeProps) {
21 const containerRef = React.useRef<HTMLDivElement>(null)
22 const [contentWidth, setContentWidth] = React.useState(0)
23 const scopedId = React.useId().replace(/:/g, "")
24 const [paused, setPaused] = React.useState(false)
25
26 React.useEffect(() => {
27 const el = containerRef.current
28 if (!el) return
29 const measure = () => {
30 const first = el.firstElementChild as HTMLElement | null
31 if (first) setContentWidth(first.scrollWidth)
32 }
33 measure()
34 const ro = new ResizeObserver(measure)
35 ro.observe(el)
36 return () => ro.disconnect()
37 }, [children])
38
39 const duration = contentWidth > 0 ? contentWidth / speed : 0
40 const keyframeName = `marquee-${scopedId}`
41
42 const from = direction === "left" ? "0%" : "-50%"
43 const to = direction === "left" ? "-50%" : "0%"
44
45 return (
46 <div className={cn("overflow-hidden", className)}>
47 <style>{`
48 @keyframes ${keyframeName} {
49 from { transform: translateX(${from}); }
50 to { transform: translateX(${to}); }
51 }
52 `}</style>
53 <div
54 ref={containerRef}
55 className="flex w-max"
56 style={{
57 animationName: keyframeName,
58 animationDuration: `${duration}s`,
59 animationTimingFunction: "linear",
60 animationIterationCount: "infinite",
61 animationPlayState: paused ? "paused" : "running",
62 }}
63 onMouseEnter={() => pauseOnHover && setPaused(true)}
64 onMouseLeave={() => pauseOnHover && setPaused(false)}
65 >
66 <div className="flex shrink-0">{children}</div>
67 <div className="flex shrink-0" aria-hidden>
68 {children}
69 </div>
70 </div>
71 </div>
72 )
73}
74Marquee.displayName = "Marquee"
75
76export { Marquee }
77export type { MarqueeProps }

What it pulls in

npm packages

  • clsx
  • tailwind-merge

Files it writes

  • registry/wise-ui/components/marquee.tsx

Facts

Registry
wise-ui
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on wise-ui wise-ui.com r-pathak/wise-ui on GitHub Raw registry item This item as JSON

More from wise-ui

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Tabsanimated-tabswise-uiComponentsFree3 deps
Border Beamborder-beamwise-uiComponentsFree3 deps
Data Tabledata-tablewise-uiComponentsFree3 deps
Dockdockwise-uiComponentsFree3 deps
Dot Matrixdot-matrixwise-uiComponentsFree2 deps
Editable Texteditable-textwise-uiComponentsFree4 deps
Gradient Sidebargradient-sidebarwise-uiComponentsFree3 deps
Kanban Boardkanban-boardwise-uiComponentsFree6 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex