Marquee
Web (React)
A seamless, infinitely scrolling row of elements.
A highly resilient marquee. Instead of using fragile CSS keyframes, it drives the scroll with Framer Motion's useAnimationFrame against a measured bounding box. This guarantees perfectly seamless wrapping without visual jumps, and allows you to pause the scroll instantly on hover.
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Installation
CLI
npx @modus-ui/cli add marqueeManual
- Copy the code from the component tab.
- Create a file at
components/ui/marquee.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | - | The elements to scroll. |
| speed | number | 60 | Pixels travelled per second. |
| direction | "left" | "right" | "left" | The direction to scroll. |
| pauseOnHover | boolean | true | Pause the scrolling when hovered. |
| fadeEdges | boolean | true | Fade the leading and trailing edges into the background. |
| className | string | "" | - |
Comments