react-clusterize
v0.2.2
Published
A Clusterize.js component for React
Downloads
23
Maintainers
Readme
react-clusterize
React component for Clusterize.js
Demo: https://cheton.github.io/react-clusterize
Installation
- Install the latest version of react and react-clusterize:
npm install --save react react-dom react-clusterize
Usage
import React from 'react';
import ReactDOM from 'react-dom';
import Clusterize from 'react-clusterize';
const rows = [];
const maxRows = 10000;
for (let i = 0; i < maxRows; ++i) {
rows[i] = (
<div style={{ borderBottom: '1px solid #f0f0f0', padding: '5px 10px' }}>
Item #{i + 1}
</div>
);
}
rows.length = maxRows;
const mountNode = document.getElementById('#container');
ReactDOM.render(<Clusterize rows={rows} />, mountNode);
API
Properties
Name | Type | Default | Description :--- | :--- | :------ | :---------- rows | array | [] | An array of React elements or HTML tags in String. scrollTop | number | 0 | Set the current vertical position of the scroll bar.
License
MIT