### Sample App with Marquee Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md A complete example showing how to use Marquee with custom components inside a React app. ```jsx import React from "react"; import MyComponent from "../components/MyComponent"; import Marquee from "react-fast-marquee"; const App = () => ( ); export default App; ``` -------------------------------- ### Install with npm Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md Install the react-fast-marquee package using npm. ```sh npm install react-fast-marquee --save ``` -------------------------------- ### onFinish Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md A callback for when the marquee finishes scrolling and stops. Only calls if loop is non-zero. ```APIDOC ## onFinish ### Description A callback for when the marquee finishes scrolling and stops. Only calls if loop is non-zero. ### Type `{() => void}` ### Default `null` ### Usage Pass a function to be called when the marquee finishes scrolling and stops. ### Example ```jsx console.log('Finished')} /> ``` ``` -------------------------------- ### Install with yarn Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md Install the react-fast-marquee package using yarn. ```sh yarn add react-fast-marquee ``` -------------------------------- ### onCycleComplete Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md A callback for when the marquee finishes a loop. Does not call if maximum loops are reached (use onFinish instead). ```APIDOC ## onCycleComplete ### Description A callback for when the marquee finishes a loop. Does not call if maximum loops are reached (use onFinish instead). ### Type `{() => void}` ### Default `null` ### Usage Pass a function to be called when the marquee finishes a loop. ### Example ```jsx console.log('Cycle complete')} /> ``` ``` -------------------------------- ### children Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md The children rendered inside the marquee. ```APIDOC ## children ### Description The children rendered inside the marquee. ### Type `ReactNode` ### Default `null` ### Usage Pass the content to be displayed inside the marquee. ### Example ```jsx Your content here ``` ``` -------------------------------- ### onMount Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md A callback function that is invoked once the marquee has finished mounting. It can be utilized to recalculate the page size, if necessary. ```APIDOC ## onMount ### Description A callback function that is invoked once the marquee has finished mounting. It can be utilized to recalculate the page size, if necessary. ### Type `{() => void}` ### Default `null` ### Usage Pass a function to be called when the marquee has finished mounting. ### Example ```jsx console.log('Mounted')} /> ``` ``` -------------------------------- ### Basic Marquee usage Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md Wrap any component or text with tags to create a sliding marquee effect. ```jsx I can be a React component, multiple React components, or just some text. ``` -------------------------------- ### Import Marquee component Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md Import the Marquee component from 'react-fast-marquee' before using it in your file. ```jsx import Marquee from "react-fast-marquee"; ``` -------------------------------- ### Consuming the module in application code Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/index.md In a bundler environment with a TS/JSX loader, the default import is the component and the type is available via import type. The example shows usage with props and JSX. ```tsx import Marquee, { MarqueeProps } from "react-fast-marquee"; const props: MarqueeProps = { speed: 100, direction: "left" }; const App = () => Sliding content; ``` -------------------------------- ### Marquee Component Source: https://github.com/justin-chu/react-fast-marquee/blob/master/README.md The Marquee component is a React component that creates a sliding marquee effect. It can wrap any React component or text and supports various props for customization. ```APIDOC ## Marquee Component ### Description The Marquee component is a React component that creates a sliding marquee effect. It can wrap any React component or text and supports various props for customization. ### Usage Import the component and wrap it around any content you want to slide. ```jsx import Marquee from "react-fast-marquee"; I can be a React component, multiple React components, or just some text. ``` ### Props | Property | Type | Default | Description | | :--- | :--- | :--- | :--- | | `style` | `CSSProperties` | `{}` | Inline style for the container div | | `className` | `string` | `""` | Name of the css class to style the container div | | `autoFill` | `boolean` | `false` | Whether to automatically fill blank space in the marquee with copies of the children or not | | `play` | `boolean` | `true` | Whether to play or pause the marquee | | `pauseOnHover` | `boolean` | `false` | Whether to pause the marquee when hovered | | `pauseOnClick` | `boolean` | `false` | Whether to pause the marquee when clicked | | `direction` | `"left" \| "right"\| "up"\| "down"` | `"left"` | The direction the marquee slides

**Warning:** Vertical marquees are currently experimental and may be buggy. Please swap the values of the marquee's height and width when setting them | | `speed` | `number` | `50` | Speed calculated as pixels/second | | `delay` | `number` | `0` | Duration to delay the animation after render, in seconds | | `loop` | `number` | `0` | The number of times the marquee should loop, 0 is equivalent to infinite | | `gradient` | `boolean` | `false` | Whether to show the gradient or not | | `gradientColor` | `string` | `white` | The color of the gradient | | `gradientWidth` | `number \| string` | `200` | The width of the gradient on either side | ``` -------------------------------- ### Advanced Marquee configuration with ref and callbacks Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/marquee.md Configures pause behavior, direction, gradient, callbacks, and a controlled ref. Includes onMount, onCycleComplete, and onFinish callbacks. Requires a ResizeObserver polyfill in environments without it. ```tsx import React, { useRef } from "react"; import Marquee from "react-fast-marquee"; const App = () => { const containerRef = useRef(null); return ( { // fired once after the marquee mounts if (containerRef.current) { console.log("container width:", containerRef.current.getBoundingClientRect().width); } }} onCycleComplete={() => console.log("one loop finished")} onFinish={() => console.log("all 5 loops finished; stopped")} > Breaking news: it slides. ); }; ``` -------------------------------- ### Exact source of src/index.tsx Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/index.md The package entry point re-exports the Marquee component and its props type. It defines no other symbols. ```tsx import Marquee, { MarqueeProps } from "./components/Marquee"; export default Marquee; export type { MarqueeProps }; ``` -------------------------------- ### Defensive handling for missing ResizeObserver Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/marquee.md Checks for ResizeObserver availability and warns if missing. The marquee still renders but widths won't recalculate without a polyfill. ```tsx import React, { useEffect } from "react"; import Marquee from "react-fast-marquee"; const App = () => { useEffect(() => { if (typeof (window as any).ResizeObserver === "undefined") { // polyfill or feature-flag the marquee console.warn("ResizeObserver missing; marquee widths will not recalculate"); } }, []); return {"a", "b", "c"].join(" · ")}; }; ``` -------------------------------- ### Import from package root Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/index.md TypeScript/bundler consumers can import the default component and the named type export from the package root. ```tsx import Marquee from "react-fast-marquee"; import type { MarqueeProps } from "react-fast-marquee"; ``` -------------------------------- ### Marquee Component Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/types.md The Marquee component is the default export of the package. It accepts MarqueeProps as props and returns a ReactElement or null until mounted. ```APIDOC ## Marquee Component ### Description The Marquee component is the default export of the package. It accepts MarqueeProps as props and returns a ReactElement or null until mounted. ### Signature `FC` ### Props - **MarqueeProps** (object) - Required - The props object for the Marquee component. - **style** (CSSProperties) - Optional - CSS properties for styling. - **children** (ReactNode) - Optional - The content to be displayed inside the marquee. - **ref** (Ref) - Optional - A ref to the underlying div element. ### Returns - **ReactElement | null** - The rendered JSX tree, or null until the component is mounted. ### Source `src/components/Marquee.tsx:123` ``` -------------------------------- ### MarqueeProps Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/types.md The props interface for the Marquee component. It defines all configurable options for the marquee behavior, styling, and callbacks. ```APIDOC ## MarqueeProps ### Description The `MarqueeProps` type defines the configuration options for the Marquee component. It includes styling, animation, behavior, and callback properties. ### Type Definition ```tsx export type MarqueeProps = { style?: CSSProperties; className?: string; autoFill?: boolean; play?: boolean; pauseOnHover?: boolean; pauseOnClick?: boolean; direction?: "left" | "right" | "up" | "down"; speed?: number; delay?: number; loop?: number; gradient?: boolean; gradientColor?: string; gradientWidth?: number | string; onFinish?: () => void; onCycleComplete?: () => void; onMount?: () => void; children?: ReactNode; } & RefAttributes; ``` ### Properties #### `style` - **Type**: `CSSProperties` - **Required**: No - **Default**: `{}` - **Description**: Inline style for the container div. #### `className` - **Type**: `string` - **Required**: No - **Default**: `""` - **Description**: Class name to style the container div. #### `autoFill` - **Type**: `boolean` - **Required**: No - **Default**: `false` - **Description**: Whether to automatically fill blank space in the marquee with copies of the children. #### `play` - **Type**: `boolean` - **Required**: No - **Default**: `true` - **Description**: Whether to play or pause the marquee. #### `pauseOnHover` - **Type**: `boolean` - **Required**: No - **Default**: `false` - **Description**: Whether to pause the marquee when hovered. #### `pauseOnClick` - **Type**: `boolean` - **Required**: No - **Default**: `false` - **Description**: Whether to pause the marquee when clicked. #### `direction` - **Type**: `"left" | "right" | "up" | "down"` - **Required**: No - **Default**: `"left"` - **Description**: The direction the marquee is sliding. #### `speed` - **Type**: `number` - **Required**: No - **Default**: `50` - **Description**: Speed calculated as pixels/second. #### `delay` - **Type**: `number` - **Required**: No - **Default**: `0` - **Description**: Duration to delay the animation after render, in seconds. #### `loop` - **Type**: `number` - **Required**: No - **Default**: `0` - **Description**: The number of times the marquee should loop; `0` is equivalent to infinite. #### `gradient` - **Type**: `boolean` - **Required**: No - **Default**: `false` - **Description**: Whether to show the gradient overlay. #### `gradientColor` - **Type**: `string` - **Required**: No - **Default**: `"white"` - **Description**: The color of the gradient. #### `gradientWidth` - **Type**: `number | string` - **Required**: No - **Default**: `200` - **Description**: The width of the gradient on either side; `number` → `px`, `string` passed through. #### `onFinish` - **Type**: `() => void` - **Required**: No - **Default**: (absent) - **Description**: A callback for when the marquee finishes scrolling and stops. Only calls if `loop` is non-zero. #### `onCycleComplete` - **Type**: `() => void` - **Required**: No - **Default**: (absent) - **Description**: A callback for when the marquee finishes a loop. Does not call if maximum loops are reached (use `onFinish` instead). #### `onMount` - **Type**: `() => void` - **Required**: No - **Default**: (absent) - **Description**: A callback function invoked once the marquee has finished mounting. Can be used to recalculate page size if necessary. #### `children` - **Type**: `ReactNode` - **Required**: No - **Default**: (absent) - **Description**: The children rendered inside the marquee. #### `ref` (from `RefAttributes`) - **Type**: `Ref` - **Required**: No - **Description**: Forwarded ref; attached to the outer container div (`.rfm-marquee-container`). Consumed as `MutableRefObject`. ``` -------------------------------- ### Marquee with multiple child components Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/marquee.md Shows how to pass multiple React components as children to the Marquee. Each child is rendered in sequence. ```tsx import React from "react"; import Marquee from "react-fast-marquee"; import MyComponent from "../components/MyComponent"; const App = () => ( ); ``` -------------------------------- ### CommonJS require usage Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/index.md In CommonJS (Node or non-bundled environments), the compiled dist/index.js is a CJS module with exports: "named", so the component lives on default with an __esModule marker. ```js const Marquee = require("react-fast-marquee").default; ``` -------------------------------- ### Marquee component return JSX Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/marquee.md Returns null before mount, otherwise renders the marquee container with optional gradient overlay, animated track, and continuation track. The first track includes the initial child container and extra copies of children; the second track contains multiplier copies. ```tsx return !isMounted ? null : (
{gradient &&
}
{Children.map(children, (child) =>
{child}
)}
{multiplyChildren(multiplier - 1)}
{multiplyChildren(multiplier)}
); ``` -------------------------------- ### MarqueeProps Type Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/README.md The `MarqueeProps` type defines the configuration options for the `Marquee` component. It is exported from the package entry point and the implementation module. The type is fully expanded in the types documentation, with a field table describing each prop. ```APIDOC ## MarqueeProps Type ### Description The `MarqueeProps` type is a TypeScript interface that defines the props accepted by the `Marquee` component. It is exported from the package entry point (`src/index.tsx`) and the implementation module (`src/components/Marquee.tsx`). ### Type Definition ```ts export type MarqueeProps = { ... }; ``` ### Fields Refer to the types documentation for the complete field table, including each prop's name, type, and description. ``` -------------------------------- ### Basic text marquee with react-fast-marquee Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/marquee.md Renders a simple marquee with text content. The Marquee component accepts React components or plain text as children. ```tsx import React from "react"; import Marquee from "react-fast-marquee"; const App = () => ( I can be a React component, multiple React components, or just some text. ); export default App; ``` -------------------------------- ### Marquee Component Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/README.md The default export of the react-fast-marquee library. A lightweight React component that renders a CSS-animation-driven marquee. It accepts a set of props defined by the MarqueeProps type and forwards a ref to the underlying DOM element. ```APIDOC ## Marquee Component ### Description The `Marquee` component is the primary export of the react-fast-marquee library. It renders a marquee effect using CSS animations and accepts configuration via props. It supports a `forwardRef` signature, allowing a ref to be attached to the underlying DOM element. ### Signature ```tsx const Marquee = forwardRef(...) ``` ### Props See the `MarqueeProps` type for the full list of accepted props. ### Usage ```tsx import Marquee from 'react-fast-marquee'; Your content here ``` ``` -------------------------------- ### Marquee Component Props Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/configuration.md The Marquee component accepts a set of optional props that control its behavior and appearance. All props are optional and have default values applied via destructuring defaults. ```APIDOC ## Marquee Component Props ### Description The `Marquee` component is the primary API of `react-fast-marquee`. It accepts a set of optional props that control its behavior and appearance. All props are optional and have default values applied via destructuring defaults. ### Props #### `style` - **Type**: `CSSProperties` - **Required**: No - **Default**: `{}` - **Description**: Inline style for the container div. #### `className` - **Type**: `string` - **Required**: No - **Default**: `""` - **Description**: Class name for the container div. #### `autoFill` - **Type**: `boolean` - **Required**: No - **Default**: `false` - **Description**: Fill blank space with copies of the children. #### `play` - **Type**: `boolean` - **Required**: No - **Default**: `true` - **Description**: Play or pause the marquee. #### `pauseOnHover` - **Type**: `boolean` - **Required**: No - **Default**: `false` - **Description**: Pause the marquee when hovered. #### `pauseOnClick` - **Type**: `boolean` - **Required**: No - **Default**: `false` - **Description**: Pause the marquee when clicked. #### `direction` - **Type**: `"left" | "right" | "up" | "down"` - **Required**: No - **Default**: `"left"` - **Description**: Direction the marquee slides. #### `speed` - **Type**: `number` - **Required**: No - **Default**: `50` - **Description**: Speed in pixels/second. #### `delay` - **Type**: `number` - **Required**: No - **Default**: `0` - **Description**: Delay after render before animation starts, in seconds. #### `loop` - **Type**: `number` - **Required**: No - **Default**: `0` - **Description**: Number of loops; `0` is equivalent to infinite. #### `gradient` - **Type**: `boolean` - **Required**: No - **Default**: `false` - **Description**: Whether to show the gradient overlay. #### `gradientColor` - **Type**: `string` - **Required**: No - **Default**: `"white"` - **Description**: Color of the gradient. #### `gradientWidth` - **Type**: `number | string` - **Required**: No - **Default**: `200` - **Description**: Width of the gradient on either side; `number` is interpreted as pixels (`${n}px`), `string` used verbatim. #### `onFinish` - **Type**: `() => void` - **Required**: No - **Default**: (none) - **Description**: Callback when the marquee finishes scrolling and stops; only invoked when `loop` is non-zero. #### `onCycleComplete` - **Type**: `() => void` - **Required**: No - **Default**: (none) - **Description**: Callback after each completed loop; not invoked on the maximum loop (use `onFinish`). #### `onMount` - **Type**: `() => void` - **Required**: No - **Default**: (none) - **Description**: Callback invoked once after mounting; intended for recalculating page size. #### `children` - **Type**: `ReactNode` - **Required**: No - **Default**: (none) - **Description**: Content rendered inside the marquee. #### `ref` - **Type**: `Ref` - **Required**: No - **Default**: (none) - **Description**: Forwarded ref to the container div (from `RefAttributes`). ### Usage Example ```jsx import Marquee from "react-fast-marquee"; console.log("Finished")} onCycleComplete={() => console.log("Cycle complete")} onMount={() => console.log("Mounted")} style={{ border: "1px solid black" }} className="my-marquee" > Your content ``` ``` -------------------------------- ### Marquee component signature (forwardRef) Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/marquee.md Exact type annotation from src/components/Marquee.tsx:123. The component is a forwardRef function component of type FC that renders nothing until the mount effect has run. ```tsx const Marquee: FC = forwardRef(function Marquee( { style = {}, className = "", autoFill = false, play = true, pauseOnHover = false, pauseOnClick = false, direction = "left", speed = 50, delay = 0, loop = 0, gradient = false, gradientColor = "white", gradientWidth = 200, onFinish, onCycleComplete, onMount, children, }, ref ) { // ...hook body (lines 123-333) }); ``` -------------------------------- ### Marquee Component Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/marquee.md The Marquee React component is a CSS-animation-driven marquee that accepts a set of props to control its behavior and appearance. It is a forwardRef function component that exposes the container HTMLDivElement through the ref. ```APIDOC ## Component: `Marquee` ### Description The `Marquee` React component is a CSS-animation-driven marquee. It is a `forwardRef` function component of type `FC`, exposing the container `HTMLDivElement` through the ref. It renders nothing (`null`) until the mount effect has run. ### Signature ```tsx const Marquee: FC = forwardRef(function Marquee( { style = {}, className = "", autoFill = false, play = true, pauseOnHover = false, pauseOnClick = false, direction = "left", speed = 50, delay = 0, loop = 0, gradient = false, gradientColor = "white", gradientWidth = 200, onFinish, onCycleComplete, onMount, children, }, ref ) { // ...hook body }); ``` ### Props - **style** (`CSSProperties`) - Optional - Inline style object for the container div. - **className** (`string`) - Optional - Class name for the container div. - **autoFill** (`boolean`) - Optional - Fill blank space with copies of children. - **play** (`boolean`) - Optional - Play or pause. - **pauseOnHover** (`boolean`) - Optional - Pause on hover. - **pauseOnClick** (`boolean`) - Optional - Pause on click. - **direction** (`"left" | "right" | "up" | "down"`) - Optional - Slide direction. - **speed** (`number`) - Optional - Pixels per second. - **delay** (`number`) - Optional - Animation delay, seconds. - **loop** (`number`) - Optional - Loop count; 0 === infinite. - **gradient** (`boolean`) - Optional - Show edge gradients. - **gradientColor** (`string`) - Optional - Gradient color, default "white". - **gradientWidth** (`number | string`) - Optional - Gradient width per side. - **onFinish** (`() => void`) - Optional - Fired when scrolling stops (loop > 0). - **onCycleComplete** (`() => void`) - Optional - Fired after each completed loop. - **onMount** (`() => void`) - Optional - Fired once after mount. - **children** (`ReactNode`) - Optional - Content rendered inside the marquee. - **ref** (`Ref`) - Optional - Forwarded ref, must be a mutable ref object, attached to the outer container div. ### Usage Example ```tsx import Marquee from "react-fast-marquee"; Item 1 Item 2 Item 3 ``` ``` -------------------------------- ### MarqueeProps type definition (inlined-expanded) Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/marquee.md Full expansion of the MarqueeProps type, including the RefAttributes intersection and CSSProperties/ReactNode types from react. Shows all prop types and defaults. ```tsx type MarqueeProps = { style?: CSSProperties; // inline style object for the container div className?: string; // class name for the container div autoFill?: boolean; // fill blank space with copies of children play?: boolean; // play or pause pauseOnHover?: boolean; // pause on hover pauseOnClick?: boolean; // pause on click direction?: "left" | "right" | "up" | "down"; // slide direction speed?: number; // pixels per second delay?: number; // animation delay, seconds loop?: number; // loop count; 0 === infinite gradient?: boolean; // show edge gradients gradientColor?: string; // gradient color, default "white" gradientWidth?: number | string; // gradient width per side onFinish?: () => void; // fired when scrolling stops (loop > 0) onCycleComplete?: () => void; // fired after each completed loop onMount?: () => void; // fired once after mount children?: ReactNode; // content rendered inside the marquee } & RefAttributes; // React: { ref?: Ref } ``` -------------------------------- ### Marquee Component Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/api-reference/marquee.md The Marquee component is a React component that creates a scrolling marquee effect. It accepts various props to control animation, styling, and behavior. ```APIDOC ## Marquee Component ### Description The Marquee component is a React component that creates a scrolling marquee effect. It accepts various props to control animation, styling, and behavior. ### Props | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `style` | `CSSProperties` | No | `{}` | Inline style for the container div. Merged with the component's own style object (`...style` spread first, `src/components/Marquee.tsx:228`). | | `className` | `string` | No | `""` | Class name to style the container div. Concatenated as `"rfm-marquee-container " + className` (`src/components/Marquee.tsx:308`). | | `autoFill` | `boolean` | No | `false` | Whether to automatically fill blank space with copies of the children (sets `--min-width: auto` and a multiplier). | | `play` | `boolean` | No | `true` | Whether the animation runs (`--play: running \| paused`). When `false`, both pause variables are forced to `paused`. | | `pauseOnHover` | `boolean` | No | `false` | Pause on hover (drives `--pause-on-hover`). | | `pauseOnClick` | `boolean` | No | `false` | Pause on click (drives `--pause-on-click`). | | `direction` | `"left" \| "right" \| "up" \| "down"` | No | `"left"` | Slide direction. `up`/`down` swap width/height measurements, rotate the container `±90deg`, and set container width to `100vh`. | | `speed` | `number` | No | `50` | Speed in pixels/second; the animation `--duration` is derived from it (see duration below). | | `delay` | `number` | No | `0` | Animation delay in seconds (`--delay`; also used as `animation-delay`). | | `loop` | `number` | No | `0` | Loop count; `0` maps to `--iteration-count: infinite`; any truthy value maps to the literal number. | | `gradient` | `boolean` | No | `false` | When `true`, renders a `.rfm-overlay` div with fading edge gradients. | | `gradientColor` | `string` | No | `"white"` | Gradient color (`--gradient-color`). | | `gradientWidth` | `number \| string` | No | `200` | Gradient width per side; numbers render as `${n}px`, strings pass through verbatim (`--gradient-width`). | | `onFinish` | `() => void` | No | (absent) | Callback when the marquee finishes and stops. Wired to `onAnimationEnd`; only fires if `loop` is non-zero (infinite loops never end). | | `onCycleComplete` | `() => void` | No | (absent) | Callback after each completed loop. Wired to `onAnimationIteration`; does not fire on the final iteration when maximum loops are reached. | | `onMount` | `() => void` | No | (absent) | Called once after mount (guard: only invoked if `typeof onMount === "function"`). Intended for recalculating page size. | | `children` | `ReactNode` | No | (absent) | Content rendered inside the marquee, wrapped per-copy in `.rfm-child` divs. | | `ref` | `Ref` | No | (none) | From `RefAttributes`; attached to the container div. | ``` -------------------------------- ### MarqueeProps type definition Source: https://github.com/justin-chu/react-fast-marquee/blob/master/_autodocs/types.md Exact TypeScript type definition for the Marquee component's props, including all optional fields and their defaults. The type is an intersection with React's RefAttributes, adding a ref prop. All fields are optional; defaults are documented in the JSDoc comments. ```tsx export type MarqueeProps = { /** * @description Inline style for the container div * @type {CSSProperties} * @default {} */ style?: CSSProperties; /** * @description Class name to style the container div * @type {string} * @default "" */ className?: string; /** * @description Whether to automatically fill blank space in the marquee with copies of the children or not * @type {boolean} * @default false */ autoFill?: boolean; /** * @description Whether to play or pause the marquee * @type {boolean} * @default true */ play?: boolean; /** * @description Whether to pause the marquee when hovered * @type {boolean} * @default false */ pauseOnHover?: boolean; /** * @description Whether to pause the marquee when clicked * @type {boolean} * @default false */ pauseOnClick?: boolean; /** * @description The direction the marquee is sliding * @type {"left" | "right" | "up" | "down"} * @default "left" */ direction?: "left" | "right" | "up" | "down"; /** * @description Speed calculated as pixels/second * @type {number} * @default 50 */ speed?: number; /** * @description Duration to delay the animation after render, in seconds * @type {number} * @default 0 */ delay?: number; /** * @description The number of times the marquee should loop, 0 is equivalent to infinite * @type {number} * @default 0 */ loop?: number; /** * @description Whether to show the gradient or not * @type {boolean} * @default false */ gradient?: boolean; /** * @description The color of the gradient * @type {string} * @default "white" */ gradientColor?: string; /** * @description The width of the gradient on either side * @type {number | string} * @default 200 */ gradientWidth?: number | string; /** * @description A callback for when the marquee finishes scrolling and stops. Only calls if loop is non-zero. * @type {() => void} * @default null */ onFinish?: () => void; /** * @description A callback for when the marquee finishes a loop. Does not call if maximum loops are reached (use onFinish instead). * @type {() => void} * @default null */ onCycleComplete?: () => void; /** * @description: A callback function that is invoked once the marquee has finished mounting. It can be utilized to recalculate the page size, if necessary. * @type {() => void} * @default null */ onMount?: () => void; /** * @description The children rendered inside the marquee * @type {ReactNode} * @default null */ children?: ReactNode; } & RefAttributes; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.