0.3.27 • Published 5 years ago

uxcore-album v0.3.27

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

uxcore-album

React album

NPM version build status Test Coverage Dependency Status devDependency Status NPM downloads

Sauce Test Status

Development

git clone https://github.com/uxcore/uxcore-album
cd uxcore-album
npm install
npm run server

if you'd like to save your install time,you can use uxcore-tools globally.

npm install uxcore-tools -g
git clone https://github.com/uxcore/uxcore-album
cd uxcore-album
npm install
npm run dep
npm run start

Test Case

npm run test

Coverage

npm run coverage

Demo

http://uxcore.github.io/components/album

Contribute

Yes please! See the CONTRIBUTING for details.

API

Album.Props

NameTypeRequiredDefaultComments
widthnumber or stringno''the default image cover's width
heightnumber or stringno''the default image cover's height
currentnumberno0the current shown photo index
enableKeyBoardControlbooleannotruewhether the album can be controlled by the keyboard navigation
maskClosablebooleannotruewhether click mask to close, this prop will be ignored if set closable prop to false
enableThumbsbooleannofalsewhether the show thumbnail list
thumbPlacementstringnorightthe placement of thumbnail, you can set 'top'/'right'/'bottom'/'left'/
thumbBackgroundstringno#000if the image couldn't cover the gird, give it a background
showButtonbooleannofalseshow the function button(zoomIn/zoomOut)
customButtons{ icon: ReactElement, onClick: function } | Array<{ icon: ReactElement, onClick: function }>no[]custom function buttons which would be put between zoomIn button and zoomOut button
onChangefunction(index)noCallback method when change
onOpenfunction(index)noCallback method when open
onClosefunctionnoCallback method when close

Photo.Props

NameTypeRequiredDefaultComments
srcstringyes''same as img's src
thumb-srcstringno''set thumbnail image source if 'enableThumbs' is true

Method

Album.show(config)

With this method, the component can be used by calling Album.show({src: 'foo/url'}) or Album.show({photos: [<Photo src="#url1" />, <Photo src="#url2" />]}) directly.

config

NameTypeRequiredDefaultComments
srcstringfalsenullthe image src
photosarray of Photofalse[]array of Photo element
getContainerfunctionfalsethe function will append a new div to document body.define the container which album rendered into
onChnagefunction(index)falseCallback method when change
onClosefunction()falseCallback method when close
showButtonbooleannofalseshow the function button(zoomIn/zoomOut)
customButtons{ icon: ReactElement, onClick: function } | Array<{ icon: ReactElement, onClick: function }>no[]custom function buttons which would be put between zoomIn button and zoomOut button
0.3.27

5 years ago

0.3.26

6 years ago

0.3.25

6 years ago

0.3.23

6 years ago

0.3.22

6 years ago

0.3.21

6 years ago

0.3.20

6 years ago

0.3.18

6 years ago

0.3.17

7 years ago

0.3.16

7 years ago

0.3.15

7 years ago

0.3.14

7 years ago

0.3.13

7 years ago

0.3.12

7 years ago

0.3.11

8 years ago

0.3.10

8 years ago

0.3.9

8 years ago

0.3.8

8 years ago

0.3.7

8 years ago

0.3.6

8 years ago

0.3.5

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago