framer-motion-ticker
Version:
A React component that acts like a ticker, or marquee.
70 lines (53 loc) • 1.88 kB
Markdown
with `framer-motion`. Infinitely and seamlessly scroll through elements.
[![NPM Version][npm-version-image]][npm-url]
[![NPM Install Size][npm-install-size-image]][npm-install-size-url]
[![NPM Downloads][npm-downloads-image]][npm-downloads-url]
```
npm install framer-motion-ticker
```
```jsx
import React from 'react';
import Ticker from 'framer-motion-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;
```
[ ](https://framer-motion-ticker-example.netlify.app/)
[ ](https://github.com/andremov/framer-motion-ticker/tree/main/example)
| props | type | default | description |
| -------- | ------ | ------- | ----------------------- |
| duration | number | 10 | duration of one segment |
```
cd example && npm install
npm run dev
```
[ ]: https://badgen.net/npm/dm/framer-motion-ticker
[ ]: https://npmcharts.com/compare/framer-motion-ticker?minimal=true
[ ]: https://badgen.net/packagephobia/install/framer-motion-ticker
[ ]: https://packagephobia.com/result?p=framer-motion-ticker
[ ]: https://npmjs.org/package/framer-motion-ticker
[ ]: https://badgen.net/npm/v/framer-motion-ticker
A simple ticker made