Package Exports
- react-trello
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-trello) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
#react-trello
Pluggable components to add a trello like kanban board to your application
Features

- responsive, extensible and light-weight
- easily pluggable into existing application
- supports pagination on scrolling individual lanes
- drag-and-drop within and across lanes
- api callback functions for all events
Getting Started
npm install --save react-trelloUsage
A simple board with a single lane can be created likewise:
<Board>
<Lane key='Lane1'
title='Planned Tasks'>
<Card key='Card1'
title='Board and Lane'
description='Trello board and Lane as components'
rightHeader='2 days'/>
<Card key='Card2'
title='Card as component'
description='Model a simple card component'
rightHeader='1 day'/>
</Lane>
</Board>Refer to storybook for detailed examples: https://rcdexta.github.io/react-trello/
Documentation
Board
This is the container component that encapsulates the lanes and cards
| Name | Type | Description |
|---|---|---|
| draggable | boolean | Makes all cards in the lanes draggable. Default: false |
| onDragStart | function | Callback function triggered when card drag is started: onDragStart(cardId, laneId) |
| onDragEnd | function | Callback function triggered when card drag ends: onDragEnd(cardId, laneId) |
Lane
Each lane in the board is modeled after this component
| Name | Type | Description |
|---|---|---|
| title | string | The title for the lane |
| key | string | Unique key for the lane. Passed as param in callback functions |
| rightHeader | node | Element to be rendered on the top-right corner |
| cards | array | List of Card components as a json array. Each json element should contain id,key,title and optionaldescription |
| onScroll | function | Pagination callback function called when lane scrolled to bottom onScroll(lastCardId, laneId) |
| children | nodes | Pass Card component as children if not passed as cards prop |
Card
| Name | Type | Description |
|---|---|---|
| title | string | The title for the card |
| key | string | Unique key for the card. Passed as param in callback functions |
| rightHeader | node | Element to be rendered on the top-right corner |
| description | node | Secondary label for the card |
| onClick | function | Callback function when the card is clicked |
Refer to tests for more detailed info about the components
Development
cd react-trello/
yarn install
yarn run storybookScripts
npm run lint: Lint all js filesnpm run lintfix: fix linting errors of all js filesnpm run semantic-release: make a release. Leave it for CI to do.npm run storybook: Start developing by using storybooknpm run test: Run tests. tests file should be written as*.test.jsand using ES2015npm run test:watch: Watch tests while writingnpm run test:cover: Show coverage report of your testsnpm run test:report: Report test coverage to codecov.io. Leave this for CInpm run build: transpile all ES6 component files into ES5(commonjs) and put it indistdirectorynpm run docs: create static build of storybook indocsdirectory that can be used for github pages
Learn how to write stories here
License
MIT