Marquee
An animated scrolling container that creates a continuous, infinite loop of content with support for both horizontal and vertical directions.
Import
Usage
Examples
Axis
Direction
Speed presets
Custom speed
Gap
Pause on hover
Fade edges
With images
Combined example
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode[] | None | Array of items to scroll (required) |
axis | "x" | "y" | "x"* | Scroll direction axis |
direction | "forward" | "reverse" | "forward"* | Scroll direction |
speed | "slow" | "normal" | "fast" | number | "normal"* | Scroll speed (preset or seconds per loop) |
gap | string | "1.5rem"* | Gap between items |
pauseOnHover | boolean | false* | Pause animation on hover |
fadeEdges | boolean | false* | Fade edges of the container |
itemClassName | string | None | Extra classes applied to each item |
className | string | None | Extra classes, merged with internal styles |
* Falls back through Global Configuration if not set. See below.
Global Configuration
Marquee reads defaults from four places, in this order of precedence:
- Instance prop: set directly on
<Marquee /> - Component config:
components.marqueein yourashee.config - Built-in fallback: component's internal default values
Component config
Built-in fallbacks
Accessibility
- Uses
aria-hiddenon duplicate content sets to prevent screen reader duplication - Pauses on hover by default to support users with vestibular disorders
- Animation respects
prefers-reduced-motionvia CSS - Content remains accessible even when paused
Notes
- Speed Values: The preset speeds correspond to
slow(50s),normal(30s), andfast(15s) per full loop. You can also provide a custom number of seconds. - Duplication: The marquee automatically duplicates its children to create the infinite scrolling effect. The duplicate set is hidden from screen readers with
aria-hidden. - Fade Edges: When enabled, the edges of the container fade to the background color for a smoother visual effect.
- Axis:
xscrolls horizontally,yscrolls vertically. - Direction:
forwardscrolls in the natural direction (left or up),reversescrolls in the opposite direction.