# waterfall-react

> Responsive and Interactive Pinterest Like Image Gallery by React

Latest version **1.0.2** (published 2017-02-12) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install waterfall-react
pnpm add waterfall-react
yarn add waterfall-react
bun add waterfall-react
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-02-12 |
| First published | 2017-02-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Baozier |
| Maintainers | byn9826 |
| Keywords | React, Pinterest, Responsive, Interactive, Component |

## Links

- npm: https://www.npmjs.com/package/waterfall-react
- Repository: https://github.com/byn9826/WaterfallReact
- Homepage: https://github.com/byn9826/WaterfallReact#readme
- Issues: https://github.com/byn9826/WaterfallReact/issues
- npm.io page: https://npm.io/package/waterfall-react

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^15.4.2
- [babel-cli](https://npm.io/package/babel-cli.md) ^6.22.2
- [babel-preset-react](https://npm.io/package/babel-preset-react.md) ^6.22.0
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.22.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-02-12
- 1.0.1 — 2017-02-12
- 1.0.0 — 2017-02-12
- 0.0.2 — 2017-02-12
- 0.0.1 — 2017-02-12

## README

# WaterfallReact
Responsive and Interactive Pinterest Like Image Gallery by React

##install
```
npm install waterfall-react;
```
```
import Waterfall from "waterfall-react";
```
##Usage
```
let images = [
    ["url/0.jpg", "message0"],
    ["url/1.jpg", "message1"],
    ["url/2.jpg", "message2"],
    ["url/3.jpg", "message3"],
    ["url/4.jpg", "message4"],
    ["url/5.jpg", "message5"],
    ...
];
...
clickNumber(index) {
    console.log(index);
}
...
<Waterfall column="3" image={images} /> //when you don't want interact with click on images
<Waterfall column="5" image={images} clickNumber={this.clickNumber.bind(this)} />
```
1. Passing all the images url and message you want to show above the image, pass it to Waterfall-React by an array. Waterfall-React will automatically layout all the images by the number of columns you defined.
2. Show messages above images when mouser over.
3. All the images is responsive according to screen width and the messages above images is responsive too.
4. Automatically balance the height of each column. Make all the columns balanced.
5. Return the index number of the image in the array if users click on it.

##Example
[Demo](http://www.thousanday.com/waterfall)<br/>
1. Auto layout by columns numbers you defined<br/>
![columns](https://raw.githubusercontent.com/byn9826/WaterfallReact/master/~markdown/1.JPG)<br/>
2. Responsive with Screens<br/>
![responsive](https://raw.githubusercontent.com/byn9826/WaterfallReact/master/~markdown/2.JPG)<br/>
3. Even the height of each column<br/>
![height](https://raw.githubusercontent.com/byn9826/WaterfallReact/master/~markdown/3.JPG)<br/>
3. Return index number of the image in array after users click on it<br/>
![index](https://raw.githubusercontent.com/byn9826/WaterfallReact/master/~markdown/4.JPG)<br/>

---
_Source: https://npm.io/package/waterfall-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
