Marquee <pm-marquee>
Marquee: a row of items that scrolls by without end, for customer logos, testimonials or a ticker.
“We shipped the redesign in a week.”
Ada, Northwind
“The first theme our designers did not fight.”
Grace, Contoso
“Dark mode was one line.”
Linus, Fabrikam
“Our forms pass every audit now.”
Mina, Tailspin
Overview
Put the items in it. To loop without a gap the element adds copies of them after your own (marked data-pm-copy, hidden from assistive technology and from the keyboard); your items are not moved or changed. It pauses while the pointer is over it or focus is inside it, and a "Pause" button appears on keyboard focus. With reduced motion (the system setting, or motion="none" / "reduced") it does not move: the items become a row the reader scrolls. A sideways marquee is as wide as its container (its items never widen a grid or flex parent); vertical needs a height: set --pm-marquee-size.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
label | string | — | Accessible name of the group, e.g. "Customers". |
speed | number | 40 | Speed in pixels per second (default 40). |
vertical | boolean | false | Scroll upwards instead of sideways. |
reverse | boolean | false | Scroll the other way. |
pause | 'hover' | 'never' | — | hover (default) pauses under the pointer and while focus is inside; never keeps moving. |
paused | boolean | false | Stopped. Set it, or call stop() and play(). |
fade | boolean | false | Fade the two edges out. |
pause-labelprop: pauseLabel | string | — | Text of the pause button (default "Pause"). |
play-labelprop: playLabel | string | — | Text of the button while paused (default "Play"). |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Slots
| Slot | Description |
|---|---|
(default) | The items (logos, cards, text). |
CSS parts
| Part | Description |
|---|---|
::part(base) | The clipping container. |
::part(track) | One run of the items. |
Methods
stop(), play(), refresh()