0.9.3 • Published 3 years ago
@andremov/react-ticker v0.9.3
React Ticker
A simple ticker made for React. Infinitely and seamlessly scroll through elements.
Installation
npm install @andremov/react-tickerBasic Usage
import React from 'react';
import Ticker from '@andremov/react-ticker';
function App() {
  const colors = ['#632bf3', '#f122c8', '#f16022', '#9ef344', '#44d3f3'];
  return (
    <div className="App">
      <Ticker duration={20}>
        {colors.map((item, index) => (
          <div
            key={index}
            style={{
              backgroundColor: item,
              margin: '5px',
              height: '250px',
              width: '200px',
            }}
          />
        ))}
      </Ticker>
    </div>
  );
}
export default App;Examples
Ticker props
| props | type | default | description | 
|---|---|---|---|
| duration | number | 10 | duration of one segment | 
Using the Ticker example folder
cd example && npm install
npm run dev