0.0.1 • Published 6 years ago
react-rotate-list v0.0.1
react-rotate-list
Auto rotate list
Install
yarn add react-rotate-list
Usage
import React, { Component } from 'react'
import RotateList from 'react-rotate-list'
class Example extends Component {
render () {
const {somethingData} = this.props;
return (
<RotateList height={600}>
{somethingData.map(({title, desc}, i) => (
<li key={i}>
<h6>{title}</h6>
<p>{desc}</p>
</li>
))}
</RotateList>
)
}
}
Available Props
key | type(s) | defaultProps | description |
---|---|---|---|
style | [object] | {} | react-rotate-list's container styles |
ulStyle | [object] | {} | react-rotate-list's list wrapper style |
height | [number] | 400 | container's maxHeight (if height is smaller than list contentHeight, rotate will be disabled) |
delay | [number] | 3000 | delay to next rotate (delay must be bigger than duration) |
duration | [number] | 750 | animation transition value |
children | [element, array[element]] | children |
License
MIT © juyeong1260