Giter Site home page Giter Site logo

edulan / react-virtual-kanban Goto Github PK

View Code? Open in Web Editor NEW
34.0 4.0 16.0 5.58 MB

A Kanban component in React

Home Page: https://edulan.github.io/react-virtual-kanban/

License: MIT License

HTML 0.72% JavaScript 95.95% CSS 2.34% AppleScript 0.99%
react kanban-component virtual-scroll

react-virtual-kanban's Introduction

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

Property Type Default Description
lists Array [] Array of lists to be rendered
width Number The width of the kanban board
height Number The height of the kanban board
listWidth Number Width of each list
listComponent Function List List decorator component
itemComponent Function Item Item decorator component
itemPreviewComponent Function ItemPreview Item preview decorator component
listPreviewComponent Function List preview decorator component
onMoveRow Function Move row callback
onMoveList Function Move list callback
onDropRow Function Drop row callback
onDropList Function Drop list callback
overscanListCount Number 2 Number of lists to render before/after the visible part
overscanRowCount Number 2 Number of row items to render before/after the visible part
itemCacheKey Function id Key generator function for caching Item components

TODO

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

react-virtual-kanban's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-virtual-kanban's Issues

Add examples

Add code examples on how to use the component, how to handle lists state etc.

React 16

I can’t get this package working with React 16, are there currently any plans to add support for it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.