apeman-react-flip
v1.2.1
Published
Apeman react component for image flip
Downloads
4
Maintainers
Readme
apeman-react-flip
Apeman react component for image flip
Installation
$ npm install apeman-react-flip --save
Demo
Live demo is hosted on GitHub Pages.
Usage
'use strict'
import React from 'react'
import {ApFlip, ApFlipStyle} from 'apeman-react-flip'
const ExampleComponent = React.createClass({
getInitialState () {
return {
focusIndex: 0
}
},
render () {
return (
<div>
<ApFlipStyle />
<ApFlip images={ [
'https://raw.githubusercontent.com/apeman-asset-labo/apeman-asset-images/master/dist/dummy/01.jpg',
'https://raw.githubusercontent.com/apeman-asset-labo/apeman-asset-images/master/dist/dummy/02.jpg',
'https://raw.githubusercontent.com/apeman-asset-labo/apeman-asset-images/master/dist/dummy/03.jpg',
'https://raw.githubusercontent.com/apeman-asset-labo/apeman-asset-images/master/dist/dummy/04.jpg',
'https://raw.githubusercontent.com/apeman-asset-labo/apeman-asset-images/master/dist/dummy/05.jpg',
'https://raw.githubusercontent.com/apeman-asset-labo/apeman-asset-images/master/dist/dummy/06.jpg'
] }
focusIndex={ state.focusIndex }
onFlip={ (amount) => s.setState({ focusIndex: s.state.focusIndex + amount })}
onClose={ () => s.setState({ focusIndex: -1 })}
/>
<a onClick={ () => s.setState({ focusIndex: 0 })}> Show Flip</a>
</div>
)
}
})
Components
ApFlipStyle
Props
| Name | Type | Default | Description | | ---- | ---- | ------- | ----------- |
ApFlip
Props
| Name | Type | Default | Description | | ---- | ---- | ------- | ----------- |
License
This software is released under the MIT License.