0.2.0 • Published 7 years ago

react-virtual-kanban v0.2.0

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

React Virtual Kanban

NPM version NPM license Travis CI status

A Kanban component in React.

Demo available here: https://edulan.github.io/react-virtual-kanban/

Features

  • Fully virtualized
  • Built-in drag and drop support
  • Dynamic heights
  • Custom Item and List components

Installation

Via npm:

npm install react-virtual-kanban --save

Usage

Basic example

import React from 'react';
import ReactDOM from 'react-dom';
import { VirtualKanban } from 'react-virtual-kanban';

// Import only once
import 'react-virtual-kanban/lib/styles.css';

// Declare lists with the following structure
const lists = [
  {
    id: 'list#1',
    rows: [
      {id: 'item#1'},
      {id: 'item#2'},
      {id: 'item#3'},
      {id: 'item#4'}
    ]
  },
  {
    id: 'list#2',
    rows: [
      {id: 'item#5'},
      {id: 'item#6'},
      {id: 'item#7'},
      {id: 'item#8'}
    ]
  },
  {
    id: 'list#3',
    rows: [
      {id: 'item#9'},
      {id: 'item#10'},
      {id: 'item#11'},
      {id: 'item#12'}
    ]
  }
];

ReactDOM.render(
  <VirtualKanban
    lists={lists}
    width={800}
    height={600}
    listWidth={200}
  />,
  document.getElementById('root')
);

API

PropertyTypeDefaultDescription
listsArray[]Array of lists to be rendered
widthNumberThe width of the kanban board
heightNumberThe height of the kanban board
listWidthNumberWidth of each list
listComponentFunctionListList decorator component
itemComponentFunctionItemItem decorator component
itemPreviewComponentFunctionItemPreviewItem preview decorator component
listPreviewComponentFunctionList preview decorator component
onMoveRowFunctionMove row callback
onMoveListFunctionMove list callback
onDropRowFunctionDrop row callback
onDropListFunctionDrop list callback
overscanListCountNumber2Number of lists to render before/after the visible part
overscanRowCountNumber2Number of row items to render before/after the visible part
itemCacheKeyFunctionidKey generator function for caching Item components

TODO

  • Auto scrolling
  • Performance++
  • Doc and examples
  • Integration with state managers (Redux, Mobx...)
  • Animations
0.3.0-beta.2

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

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