Marquee
An endless row of items that scrolls by itself: customer logos, quotes, headlines. Use it for content that is pleasant to glimpse and fine to miss. For figures a reader needs to compare, use a table or a list; for live prices, the ticker tape.
Install
npx shadcn@latest add @thrum-pro/marqueeThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | The items. They are laid out in a row (or a column) with gap between them, and drawn twice. |
direction | "left" | "right" | "up" | "down" | Default "left" | Which way the content travels. up and down need a height on the marquee, through className. |
speed | number | Default 40 | Speed in pixels per second, the same however long the content is. |
gap | number | Default 32 | Space between items, and between the end of the content and its copy, in pixels. |
fade | boolean | Default true | Fade the content out over the last 48 pixels at each travelling edge (trailing edge only while paused so the first item stays crisp). |
pauseOnHover | boolean | Default true | Stop while the pointer is over the marquee and while focus is inside it. |
paused | boolean | Default false | Freeze the content where it is. |
asList | boolean | Default false | Render each copy as a <ul>, for content that is a list. Give it <li> children. |
reducedMotion | "scroll" | "wrap" | Default "scroll" | What the content becomes under reduced motion: one row that scrolls by hand, or items that wrap onto more lines. |
className | string | – | Extra classes, merged last. Set the width here, and the height for up and down. |
...props | ComponentProps<"div"> | – | Every other div attribute is passed through. Give a marquee of meaningful content role="region" and an aria-label. |
Motion and sound
Motion
- The content and a copy of it, end to end, slide by one copy's length and start again, so the seam never shows. The speed is constant, 40 pixels a second by default.
- It is a CSS animation of translate. The duration is the content's length divided by the speed, measured once and again on resize, without a React render.
- Each copy is at least as wide as the marquee, so short content spreads out to fill it rather than leave a hole.
- It stops while the pointer is over it and while focus is inside it. paused freezes it where it is.
- Reduced motion: it stands still, the copy is gone, the edges stop fading, and the row scrolls by hand (or wraps, with reducedMotion="wrap").
Sound
Silent. This component makes no sound.
Accessibility
- Screen readers read the content once. The copy is aria-hidden and inert: it takes no focus and no clicks.
- Moving content that runs for more than 5 seconds needs a way to stop it. Pausing on hover and focus is one; for content that matters, offer a pause button that sets paused, or leave the marquee paused until the reader starts it.
- Under reduced motion every item is reachable by scrolling, and nothing is hidden behind a fade.
- The marquee adds no role. Give one whose content matters role="region" and an aria-label, so a screen reader can tell where it starts.
| Keys | Action |
|---|---|
| Tab | Moves to a link or button inside the marquee, which stops it. Only the first copy takes focus. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/marquee.tsx- Packages
- None
- Brings along
- Nothing
Changelog
- 1.0.0 · 2026-12-03First release.