A lightweight and high-performance auto-scrolling (marquee) react component library.
npm install react-auto-marquee
import AutoMarquee from 'react-auto-marquee'
function App() {
return (
<div>
<AutoMarquee
style={{
width: '200px',
height: '300px'
}}
direction='vertical'
speed={0.3}
pauseOnHover={true}
>
{list.map((item, idx) => (
<div
key={idx}
style={{
border: '1px solid red',
background: 'cyan',
margin: '6px 0'
}}
>
item - {item}
</div>
))}
</AutoMarquee>
</div>
)
}
prop | type | default value |
---|---|---|
className | string | '' |
style | React.CSSProperties | {} |
speed | number | 0 |
direction | 'horizontal' | 'vertical' | 'vertical' |
pauseOnHover | boolean | true |