4.0.25 • Published 5 years ago

the-flick v4.0.25

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

the-flick

Build Status npm Version JS Standard

Flickable viewer of the-components

Installation

$ npm install the-flick --save

Usage

Live Demo is hosted on GitHub Page

'use strict'

import React from 'react'
import { TheFlick, TheFlickStyle } from 'the-flick'
import { TheButton, TheButtonStyle } from 'the-button'
import { TheSpinStyle } from 'the-spin'
import { TheImageStyle } from 'the-image'
import { TheVideoStyle } from 'the-video'

const imageUrls = [
  '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',
]

const videoUrls = [
  './mov_bbb.mp4'
]

class ExampleComponent extends React.PureComponent {
  constructor (props) {
    super(props)
    this.state = {
      activeIndex: 1,
      present: true
    }
  }

  render () {
    return (
      <div>
        <TheButtonStyle/>
        <TheSpinStyle/>
        <TheImageStyle/>
        <TheVideoStyle/>
        <TheFlickStyle/>

        <TheButton onClick={() => this.setState({present: true})}>
          Show Flick Images
        </TheButton>
        <TheFlick activeIndex={this.state.activeIndex}
                  onChange={({activeIndex}) => this.setState({activeIndex})}
                  present={this.state.present}
                  onClose={() => this.setState({present: false})}
                  images={[
                    imageUrls[0],
                    {src: imageUrls[1], spinning: true},
                    {src: imageUrls[2], title: 'Some title'},
                    {src: imageUrls[3], title: 'Some title', description: 'This is image description'},
                    {src: videoUrls[0], title: 'Some video'}
                  ]}
        />
      </div>

    )
  }
}

export default ExampleComponent

Components

TheFlick

Flickable viewer of the-components

Props

NameTypeDescriptionDefault
activeIndexnumberActive index of images0
imagesarrayOf unionImages to flip[]
onChangefuncHandle index change() => {}
onClosefuncClose handler() => {}
presentboolShows the dialogfalse
spinningboolShow spinfalse
titlestringnull

TheFlickImage

TheFlickStyle

Style for TheFlick

Props

NameTypeDescriptionDefault
optionsobjectStyle options{}

License

This software is released under the MIT License.

Links

4.0.25

5 years ago

4.0.24

5 years ago

4.0.23

5 years ago

4.0.22

5 years ago

4.0.21

5 years ago

4.0.20

5 years ago

4.0.19

5 years ago

4.0.18

5 years ago

4.0.17

5 years ago

4.0.16

5 years ago

4.0.14

6 years ago

4.0.13

6 years ago

4.0.12

6 years ago

4.0.11

6 years ago

4.0.10

6 years ago

4.0.9

6 years ago

4.0.8

6 years ago

4.0.7

6 years ago

4.0.6

6 years ago

4.0.5

6 years ago

4.0.4

6 years ago

4.0.3

6 years ago

4.0.2

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.0.0

6 years ago

2.1.8

7 years ago

2.1.7

7 years ago

2.1.6

7 years ago

2.1.5

7 years ago

2.1.4

7 years ago

2.1.3

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago