Skip to content
Enact

ui/Marquee

A component that will marquee its overflowing contents.

A minimally-styled marquee component.

Extends: ui/Marqueeui/Marquee.MarqueeBase
Wrapped with: ui/Marqueeui/Marquee.MarqueeDecorator

Marquees the children of the component.

For automated marquee calculations use ui/Marqueeui/Marquee.Marquee.

Properties

Text alignment value of the marquee

Valid values are:

  • 'left',

  • 'right', and

  • 'center'


Applies animating styles such as removing the ellipsis.


Sets the value of the aria-label attribute for the wrapped component.


The text or a set of components that should be marqueed

This prop may be empty in some cases, which is OK.


ObjectFunction

Called when mounting or unmounting with a reference to the client node


Customizes the component by mapping the supplied collection of CSS class names to the corresponding internal elements and states of this component.

The following classes are supported:

  • marquee - The root component class

  • animate - Applied to the inner content node when the text is animating

  • spacing - The spacing node used between the repeated content

  • text - The inner content node

  • willAnimate - Applied to the inner content node shortly before animation


Distance to animate the marquee

Usually, the distance is the width of the text minus the width of the container


Called when the marquee completes its animation


'clip''ellipsis'

Text overflow setting. Either 'clip' or 'ellipsis'


true if the directionality of the content is right-to-left

Default: false

Amount of spacing, in pixels, between the instances of the content

Default: 0

Speed of marquee animation in pixels/second.


Indicates the marquee will animate soon.

Should be used by the component to prepare itself for animation such as promoting composite layers for improved performance.

Default: false

A higher-order component that synchronizes contained Marquees.

Configuration

When true, any onFocus events that bubble to the controller will start the contained Marquee instances. This is useful when a component contains Marquee instances that need to be started when sibling components are focused.

Default: false

A higher-order component that provides marquee functionalities.

Note: This HoC passes additional properties to the wrapped component and wraps the children prop with an additional component necessary for rendering the marquee.

Configuration

Property containing the callback to stop the animation when marqueeOn is 'focus'

Default: 'onBlur'

The base marquee component wrapping the content.

Default: ui/Marquee.Marquee

Customizes the component by mapping the supplied collection of CSS class names to the corresponding internal elements and states of this component.

The following classes are supported:

  • marquee - The root component class

  • animate - Applied to the inner content node when the text is animating

  • spacing - The spacing node used between the repeated content

  • text - The inner content node

  • willAnimate - Applied to the inner content node shortly before animation

Default: null

Property containing the callback to start the animation when marqueeOn is 'hover'

Default: 'onMouseEnter'

Property containing the callback to start the animation when marqueeOn is 'focus'

Default: 'onFocus'

Array(String)

Invalidate the distance if any property (like 'inline') changes. Expects an array of props which on change trigger invalidateMetrics.

Default: ['remeasure']

Property containing the callback to stop the animation when marqueeOn is 'hover'

Default: 'onMouseLeave'

A function that determines the text directionality of a string.

Returns:

  • 'rtl' if the text should marquee to the right

  • 'ltr' if the text should marquee to the left

Properties added to wrapped component

Text alignment value of the marquee. Valid values are 'left', 'right' and 'center'.


Children to be marqueed


Passed through to the wrapped component.

Does not affect Marquee behavior except that components that are marqueeOn="focus" will be treated as if they were marqueeOn="hover", to allow disabled (and thus, unfocusable) components to marquee.


Forces the direction of the marquee.

Valid values are 'rtl', 'ltr', and 'locale'. This includes non-text elements as well. The default behavior, if this prop is unset, is to evaluate the text content for directionality using i18n/utili18n/util.isRtlText.

If 'locale', the direction is determined by the locale, same as ui/Marqueeui/Marquee.MarqueeDecorator.rtl. In other words, it will not consider the text content for determining the direction.


The current locale as a https://toolshttps://tools.ietf.org/html/rfc5646.


Number of milliseconds to wait before starting marquee when marqueeOn is 'hover' or 'focus' or before restarting any marquee.

Default: 1000

Disables all marquee behavior and removes supporting markup.


'focus''hover''render'

Determines what triggers the marquee to start its animation.

Default: 'focus'

Number of milliseconds to wait before starting marquee the first time.

Has no effect if marqueeOn is not 'render'

Default: 1000

Number of milliseconds to wait before resetting the marquee position after it finishes.

A minimum of 40 milliseconds is enforced.

Default: 1000

StringNumber

Amount of spacing between the instances of the content when animating.

May either be a number indicating the number of pixels or a string indicating the percentage relative to the width of the component.

Note: When using a number, the value should be based on 1920x1080 display and will be scaled automatically for the current resolution using ui/resolutionui/resolution.

Default: '50%'

Rate of marquee measured in pixels/second.

Default: 60

Indicates the text directionality of the current locale is right-to-left