1.2.1 • Published 9 years ago

apeman-react-flip v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

apeman-react-flip

Build Status npm Version JS Standard

Apeman react component for image flip

Installation

$ npm install apeman-react-flip --save

Demo

Live demo is hosted on GitHub Pages.

Demo Image

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

NameTypeDefaultDescription

ApFlip

Props

NameTypeDefaultDescription

License

This software is released under the MIT License.

Links