Marquee
Create a continuous scrolling display of logos, images, or text horizontally or vertically.
Usage
import { Marquee } from "@chakra-ui/react"<Marquee.Root>
<Marquee.Viewport>
<Marquee.Content>
<Marquee.Item />
</Marquee.Content>
</Marquee.Viewport>
</Marquee.Root>Examples
Reversed
Use the reverse prop on the Marquee.Root component to reverse the direction of
the marquee.
Vertical Animation
To animate content along the Y axis, use the side prop and set it to bottom.
Speed
Use the speed prop to control the animation speed in pixels per second.
Pause On Interaction
Use the pauseOnInteraction prop to pause the animation when the user hovers or
focuses the marquee.
Store
Use the Marquee.RootProvider and useMarquee hook to provide the marquee
instance to the component and control the animation state programmatically.
Finite Loops
To loop the marquee a finite number of times, set the loopCount prop on
Marquee.Root. Alternatively, use the onLoopComplete and onComplete
callbacks to track the number of completed loops or when the animation fully
finishes.
<Marquee.Root
loopCount={3}
onLoopComplete={() => {
/* handle loop completion */
}}
onComplete={() => {
/* handle animation end */
}}
>
{/* Marquee.Item elements */}
</Marquee.Root>Loop completed: 0 times
Animation completed: 0 times
Edge Gradient
Render the Marquee.Edge component to apply an edge fade.
Multiple
Here's an example of how to render alternating marquee components.
Diagonal
Here's an example of how to animate content diagonally using the marquee component.
News Ticker
Here's an example of how to implement a news ticker with the marquee component.
Testimonials
You can display testimonials with the marquee component.
Props
| Prop | Default | Type |
|---|---|---|
autoFill | false | booleanWhether to automatically duplicate content to fill the container. |
defaultPaused | false | booleanWhether the marquee is paused by default. |
delay | 0 | numberThe delay before the animation starts (in seconds). |
loopCount | 0 | numberThe number of times to loop the animation (0 = infinite). |
pauseOnInteraction | false | booleanWhether to pause the marquee on user interaction (hover, focus). |
reverse | false | booleanWhether to reverse the animation direction. |
side | 'start' | SideThe side/direction the marquee scrolls towards. |
spacing | 1rem | stringThe spacing between marquee items. |
speed | 50 | numberThe speed of the marquee animation in pixels per second. |
as | React.ElementTypeThe underlying element to render. | |
asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. For more details, read our Composition guide. | |
unstyled | booleanWhether to remove the component's style. | |
ids | Partial<{ root: string; viewport: string; content: (index: number) => string }>The ids of the elements in the marquee. Useful for composition. | |
onComplete | () => voidFunction called when the marquee completes all loops and stops. Only fires for finite loops (loopCount > 0). | |
onLoopComplete | () => voidFunction called when the marquee completes one loop iteration. | |
onPauseChange | (details: PauseStatusDetails) => voidFunction called when the pause status changes. | |
paused | booleanWhether the marquee is paused. | |
translations | IntlTranslationsThe localized messages to use. |