1.0.10 • Published 7 years ago

react-stylish-gallery v1.0.10

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

Build Status

Description

Create beautiful responsive image galleries with easy to use React components. Check out the demos page for more examples

Instalation

npm i -S react-stylish-gallery

or

yarn add react-stylish-gallery

Usage

import React from 'react'
import { Gallery, Image, Overlay } from 'react-stylish-gallery'

export default () => (
  <Gallery withModal>
    <Image
      src='Your url'
      alt="Image 1"
    >
      <Overlay title="My first image">
    </Image>
    <Image
      src='Your url'
      alt="Image 2"
    >
      <Overlay title="My second image">
    </Image>
  </Gallery>
)

API

Galley properties

Description: Wrap your Image components inside the Gallery. Use it only if you have 2 or more Image components.

Prop NameTypeDefaultRequierdDescription
withModalbooleanfalsefalseDefines if the images have modal when. clicked
infinitebooleanfalsefalseDefines if the modal it's infinite (eg. after clicking 'next' on the last image, the first. image will appear)
themeobject{}falseApplies style to the Modal component.

Theme object properties

Note: This object applies style only to the Modal component!

Prop NameTypeDefaultUnitOptionsDescription
animationEntrancestringscaleUpslideDownslideRightslideLeftSets the entrance animation of the modal.
animationExitstringscaleDownslideDownslideRightSets the exit animation of the modal.
animationTimenumber0s(seconds)Sets the time of the animations.
backgroundstring#000Sets the background of the modal.
rightIconClassNamestringSets the className of the right side icon.
leftIconClassNamestringSets the className of the left side icon.
rightIconNamestringSets the name of right side icon.
leftIconNamestringSets the name of the left side icon.

Image properties

Description: This is the component which contains the actual image. Adjust the size to change the space occupied by the flex.

Prop NameTypeDefaultRequierdDefinition
srcstringtruePoints to the source of your image
altstringtrueAlt in case image url is broke
sizenumber4falseSize of the image in the row
heightnumberautofalseSets the height of the image
padingnumber0falseSets the padding of the image
themeobject{}trueApplies style to the Image component
classNamestringfalseApplies style to the Image component
onClickfunctionfalseAdd custom function when clicking on the image

Theme object options

Prop NameTypeDefaultUnitDescription
paddingnumber0remSet the total padding of the current image
heightnumberautopxSet the height of the current image

Overlay properties

Description: Use to add an overlay over the Image component which can also display a text.

Prop NameTypeDefaultRequierdDescription
titlestringfalseDisplays a text over the overlay
themeobject{}trueApplies style to the Overlay component

Theme object options

Prop NameTypeDefaultUnitOptionsDescription
animationNamestringfadeInfadeInslideDownslideUpslideLeftslideRightDefines the overlay animation
animationDurationnumber0.4s(seconds)Sets the duration of the animation
animationTimingFunctionstringease-inlineareaseease-inease-outease-in-outstep-startstep-endSets the animation timing function of the animation
backgroundstring#000Sets the background of the overlay
opacitynumber0.5Sets the opacity of the background
fontSizenumber3remSets the font size of the title
colorstring#fffSets the color of the title

Copyright (c) 2017 Nichita-Alexandru Sindie

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

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

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago