
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-marquee-order
Advanced tools
A modern React seamless scroll component with TypeScript support
English | 简体中文
A modern React seamless scrolling component with perfect support for both horizontal and vertical scrolling. Built with TypeScript, featuring smooth scrolling effects, flexible configuration options, and complete type support.
Check out the live demo: React Seamless Scroll Demo
npm install react-marquee-order
# or
pnpm add react-marquee-order
# or
yarn add react-marquee-order
import React, { useRef } from 'react';
import { Marquee, MarqueeHandle } from 'react-marquee-order';
const App = () => {
const marqueeRef = useRef<MarqueeHandle>(null);
const data = [
{ text: "Seamless scroll item 1" },
{ text: "Seamless scroll item 2" },
{ text: "Seamless scroll item 3" }
];
const handleClick = (item: any, index: number) => {
console.log('Clicked:', item, 'at index:', index);
};
return (
<div style={{ width: '100%', height: '40px' }}>
<Marquee
ref={marqueeRef}
loopData={data}
speed={2}
direction="horizontal"
reverse={false}
hoverPause={true}
onClick={handleClick}
/>
</div>
);
};
export default App;
Prop | Type | Default | Description |
---|---|---|---|
loopData | Array<any> | [] | Data array for continuous scrolling |
direction | 'horizontal' | 'vertical' | 'horizontal' | Scroll direction: horizontal/vertical |
speed | number | 2 | Scroll speed (pixels per frame) |
reverse | boolean | false | Whether to scroll in reverse |
hoverPause | boolean | true | Whether to pause on hover |
onClick | (item: any, index: number) => void | - | Callback function for item clicks |
The component exposes these methods via ref:
play()
: Start scrollingpause()
: Pause scrollingreset()
: Reset positionSupports all modern browsers and IE11+ with appropriate polyfills.
Pull requests are welcome to improve this component!
MIT
[2.0.0] - 2024-12-09
FAQs
A modern React seamless scroll component with TypeScript support
The npm package react-marquee-order receives a total of 2 weekly downloads. As such, react-marquee-order popularity was classified as not popular.
We found that react-marquee-order demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.