2.0.3 • Published 2 years ago

@judsirera/acamp-gallery v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Acamp Gallery

The gallery used at Acamp, now available for your pages!

Demo

Try out a demo here

Install

npm i @judsirera/acamp-gallery

Props

ProptypeDescriptionDefault Value
imagesArrayArray of image URL[]
initialImageNumberThe index of the active image on mount0
heightNumberThe height of the wrapper component (in px)460
columnGutterNumberThe margin between slides (in px)20
columnWidthNumberThe width of the non-active slides (in px)75
sideColumnsNumberThe number of side columns considering only one side.2
containImageStringWhether the gallery should render the image with full height. Possible values: "contain", "contain_active", "off""off"
activeOnHoverBooleanSet to true if you want to active an image on hoverfalse
navigationBoolean or ObjectSets the properties for navigation. Accepts true, false or { className: '', showWhenOneImageOrLess: ''}true. When there's less than one image, navigation is hidden
loaderElementnodeThe node element to render when loading at startnull

Style Import

import '@judsirera/acamp-gallery/styles/css/acamp-gallery.css';

import '@judsirera/acamp-gallery/styles/scss/acamp-gallery.scss';

or as link in the head of your html

<link
  rel="stylesheet"
  href="https://unpkg.com/@judsirera/acamp-gallery/styles/css/acamp-gallery.css"
/>

<link
  rel="stylesheet"
  href="https://unpkg.com/@judsirera/acamp-gallery/styles/scss/acamp-gallery.scss"
/>

Example

const IMAGES = Array.from(Array(5), () => 'https://via.placeholder.com/300x200');

<AcampGallery
  images={IMAGES}
  height={460}
  columnGutter={20}
  columnWidth={75}
  sideColumns={2}
  containImage={AcampGallery.CONTAIN_OFF}
  activeOnHover={false}
  navigation={{
    className: 'your-navigation-classname',
    showWhenOneImageOrLess: false
  }}
  className='your-gallery-wrapper-classname'
/>;

Credits

Designed by Marija Vitasovic and implemented by Judith Sirera while working at Acamp

2.0.3

2 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago