Marquee

Marquee is a component that continuously scrolls content horizontally or vertically.

Usage

import { Marquee } from "@yamada-ui/react"
<Marquee.Root>
  <Marquee.Edge direction="start" />
  <Marquee.Content>
    <Marquee.Item />
  </Marquee.Content>
  <Marquee.Edge direction="end" />
</Marquee.Root>

Change Direction

To change the direction, set orientation to "horizontal" or "vertical". By default, "horizontal" is set.

Change Scroll Direction

To change the scrolling direction, set direction to "start" or "end". By default, "start" is set.

Reverse Scroll Direction

To reverse the scrolling direction, set reverse to true.

Change Speed

To change the scrolling speed, set a numerical value (pixels per second) to speed. By default, 50 is set.

Change Duration

To change the duration, set a numerical value (seconds) to duration. When set, duration takes precedence over speed.

Delay

To delay the start of the animation, set a numerical value (seconds) to delay.

Change Loop Count

To change the loop count, set loopCount to a numerical value.

Pause on Hover

To pause on hover, set pauseOnHover to true.

Pause on Focus

To pause on focus, set pauseOnFocus to true.

Add Edge Gradients

To add edge gradients, use Marquee.Edge.

Control

Props

Accessibility

When aria-label or aria-labelledby is set, it will be read aloud by screen readers.

<Marquee.Root aria-label="Technologies">
  <Marquee.Item>Yamada UI</Marquee.Item>
  <Marquee.Item>React</Marquee.Item>
  <Marquee.Item>TypeScript</Marquee.Item>
</Marquee.Root>

For interactive content, set pauseOnFocus to true so keyboard users can access each item.

Keyboard Navigation

KeyDescriptionState
SpaceToggles pause and resume when the element has focus.-

ARIA Roles and Attributes

ElementRoles and AttributesUsage
div.ui-marquee__rootrole="region"Indicates that this is a region.
aria-roledescription="marquee"Indicates that this is a marquee.
aria-live="off"Prevents repeated announcements of scrolling content.
aria-keyshortcuts="Space"Indicates the keyboard shortcut to toggle pause.
div.ui-marquee__group[data-clone]aria-hidden="true"Hides duplicated content from screen readers.
inertExcludes duplicated content from keyboard navigation.
div.ui-marquee__edgearia-hidden="true"Hides decorative gradients from screen readers.

Similar Components

Carousel

Carousel is a component that displays multiple elements like a slideshow.

ScrollArea

ScrollArea is a component that displays a customized scrollbar.