3.1.3 • Published 5 months ago

react-ikusi v3.1.3

Weekly downloads
57
License
ISC
Repository
github
Last release
5 months ago

See on NPM   See on NPM

See on Storybook   See on Storybook

A lightweight React responsive masonry component to display images. Built with CSS Flexbox:

  • Supports row direction layout
  • Configurable for different screen sizes
  • Responsive
  • Combined with a lightbox to display each image

:bulb: The word ikusi from the package name react-ikusi means see in Basque language. Click here for more information.

Getting started

You can download react-ikusi from the NPM registry via npm or yarn

yarn add react-ikusi
npm install react-ikusi --save

Demo

See react-ikusi Storybook

Example

Customizable configurations for different screen sizes | | | | ---------------------------------------------------------------------------------- | :------------------------------------------------------------------------------: | | | |

Usage

Here's the minimal setup example:

const photos = [
    {
        src: 'http://example.com/example/img1.jpg',
        width: 4,
        height: 3,
    },
    {
        src: 'http://example.com/example/img2.jpg',
        width: 1,
        height: 1,
    },
];

'https://live.staticflickr.com/65535/49595136583_f326bc8ef5_o.jpg',
    'https://live.staticflickr.com/65535/49595636006_ce5a2e029a_o.jpg',
    'https://live.staticflickr.com/65535/49595635976_7d941dac9e_o.jpg',
    'https://live.staticflickr.com/65535/49595136513_235b10c43e_o.jpg',
    'https://live.staticflickr.com/65535/49595136473_eb70b9a091_o.png';

import Gallery from 'react-ikusi';
<Gallery photos={photos} />;

Props

Photo

NameDescriptionTypeRequired
idUnique identifier of the photostringtrue
srcUrl source of the original photostringtrue
widthOriginal width of the photo in pixelsnumbertrue
heightOriginal height of the photo in pixelsnumbertrue
bigSrcUrl source of the photo in big size (for Lightbox displaying)stringfalse

\ Configuration

It is an array which may contain multiple elements for different screen sizes.

It determines the number of elements to be displayed per row and their margin.

NameDescriptionTypeRequired
colsNumber of elements per rownumbertrue
marginSpace around each element of the Gallery (px)numbertrue
minWidthMinimum width for the current configuration (px)numberfalse
maxWidthMaximum width for the current configuration (px)numberfalse

\ \ An example of Gallery layout :

3.1.3

5 months ago

3.1.2

5 months ago

3.1.1

5 months ago

3.0.2

6 months ago

3.1.0

6 months ago

3.0.1

6 months ago

3.0.0

6 months ago

2.4.0

1 year ago

2.3.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.3

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago