All Projects → hungga1711 → react-native-dnd-board

hungga1711 / react-native-dnd-board

Licence: other
A drag and drop Kanban board for React Native.

Programming Languages

javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
Starlark
911 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to react-native-dnd-board

Ngx Smooth Dnd
angular wrapper for smooth-dnd
Stars: ✭ 152 (+270.73%)
Mutual labels:  dnd, drag-and-drop, drag, drop, draggable
Smooth Dnd
drag and drop library for javascript
Stars: ✭ 408 (+895.12%)
Mutual labels:  dnd, drag-and-drop, drag, drop, draggable
Nextcloud Deck
📋 Android client for nextcloud deck app
Stars: ✭ 318 (+675.61%)
Mutual labels:  trello, board, card, kanban
Vue Smooth Dnd
Vue wrapper components for smooth-dnd
Stars: ✭ 1,121 (+2634.15%)
Mutual labels:  drag-and-drop, drag, drop, draggable
React Smooth Dnd
react wrapper components for smooth-dnd
Stars: ✭ 1,560 (+3704.88%)
Mutual labels:  drag-and-drop, drag, drop, draggable
Angular Skyhook
An implementation of react-dnd for Angular.
Stars: ✭ 146 (+256.1%)
Mutual labels:  dnd, drag-and-drop, drag, drop
React Kanban Dnd
📋 Open source kanban board built with React
Stars: ✭ 121 (+195.12%)
Mutual labels:  drag-and-drop, kanban, draggable
dnd
Beautiful and accessible drag and drop for lists with React.
Stars: ✭ 271 (+560.98%)
Mutual labels:  dnd, drag-and-drop, drag
React Beautiful Dnd
Beautiful and accessible drag and drop for lists with React
Stars: ✭ 25,810 (+62851.22%)
Mutual labels:  dnd, drag-and-drop, drag
Vue Drag And Drop Kanban
A simple kanban board where the items can be dragged and dropped from the list. This is a hybrid implementation of vue-smooth-dnd.
Stars: ✭ 93 (+126.83%)
Mutual labels:  board, drag-and-drop, kanban
React Dragline
🐼Guide lines and magnetic adsorption to better align draggable elements in React.
Stars: ✭ 134 (+226.83%)
Mutual labels:  drag-and-drop, drag, draggable
FlutterBoardView
BoardView written for the flutter framework.
Stars: ✭ 82 (+100%)
Mutual labels:  drag-and-drop, kanban, draggable
dflex
The sophisticated Drag and Drop library you've been waiting for 🥳
Stars: ✭ 806 (+1865.85%)
Mutual labels:  dnd, drag-and-drop, draggable
Gong Wpf Dragdrop
The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF
Stars: ✭ 1,669 (+3970.73%)
Mutual labels:  drag-and-drop, drag, drop
React Dragtastic
A simple drag and drop library for React which uses the more stable mouseDown/mouseUp event pattern instead of the problematic HTML5 drag and drop API
Stars: ✭ 181 (+341.46%)
Mutual labels:  dnd, drag-and-drop, draggable
Uploader
A lightweight and very configurable jQuery plugin for file uploading using ajax(a sync); includes support for queues, progress tracking and drag and drop.
Stars: ✭ 1,042 (+2441.46%)
Mutual labels:  dnd, drag, drop
Sortable
Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
Stars: ✭ 23,641 (+57560.98%)
Mutual labels:  drag-and-drop, drag, draggable
Ng2 Dnd
Angular 2 Drag-and-Drop without dependencies
Stars: ✭ 861 (+2000%)
Mutual labels:  drag-and-drop, drag, drop
vue3-smooth-dnd
Vue3 wrapper components for smooth-dnd
Stars: ✭ 92 (+124.39%)
Mutual labels:  dnd, drag-and-drop, draggable
Muuri
Infinite responsive, sortable, filterable and draggable layouts
Stars: ✭ 9,797 (+23795.12%)
Mutual labels:  dnd, drag-and-drop, draggable

React Native DnD Board

A drag and drop Kanban board for React Native using Reanimated (V1) and React Native Gesture Handler.

Installation

Step 1:

Install Reanimated V1.

Step 2:

Install React Native Gesture Handler.

Make sure your MainActivity.java was updated by follow all Android instructions.

React Native Gesture Handler IMPORTANT NOTE: If you're using wix/react-native-navigation, please wrap your board screen using gestureHandlerRootHOC (View RNGH docs for more details). If not do it, your board won't work.

Step 3:

Install this package using npm or yarn

with npm:

npm install react-native-dnd-board

with yarn:

yarn add react-native-dnd-board

API reference

The package exports a Board component which is the one you'd use to render the dnd board and a Repository class to handle column, row layout.

Board

Property Type Required Description
repository Repository yes Object that holds data
renderRow ({ item, index }) => {} yes Function responsible for rendering row item
renderColumnWrapper ({ item, index, columnComponent, layoutProps }) => {} yes Function responsible for rendering wrapper of the column
onRowPress (row) => {} no Function invoked when row pressed
onDragStart () => {} no Function invoked when drag is started
onDragEnd (fromColumnId, toColumnId, row) => {} no Function invoked when drag is finished
style StyleProp no Style of the board
columnWidth number no Initial min column width
accessoryRight function|View no Render end of the board. Useful when rendering virtual add more column.
activeRowStyle StyleProp no A custom style for the row when being dragged.
activeRowRotation number no Degrees to rotate the row when being dragged. Default is 8.
xScrollThreshold number no Offset from X to calculate scroll from. Default is 50.
yScrollThreshold number no Offset from Y for the rows. Default is 50.
dragSpeedFactor number no When dragging you can accelerate the scrollTo position. Default is 1.

Repository

Update repository data:

repository.updateData(data);

Handle column data:

repository.addColumn(data);
repository.updateColumn(columnId, data);
repository.deleteColumn(columnId);

Handle row data:

repository.addRow(columnId, data);
repository.updateRow(rowId, data);
repository.deleteRow(rowId);

Get rows with index updated:

const { rows } = repository.getItemsChanged();

Example

Usage

You need to build Repository

import Board, { Repository } from "react-native-dnd-board";

const mockData = [
  {
    id: "1",
    name: "Column 1",
    rows: [
      {
        id: "11",
        name: "Row 1 (Column 1)",
      },
      {
        id: "12",
        name: "Row 2 (Column 1)",
      },
    ],
  },
  {
    id: "2",
    name: "Column 2",
    rows: [
      {
        id: "21",
        name: "Row 1 (Column 2)",
      },
    ],
  },
];

const [repository, setRepository] = useState(new Repository(mockData));

Render the Board

<Board
  repository={repository}
  renderRow={renderCard}
  renderColumnWrapper={renderColumnWrapper}
  onRowPress={onCardPress}
  onDragEnd={onDragEnd}
/>

renderColumnWrapper function

const renderColumnWrapper = ({ item, columnComponent, layoutProps }) => {
  return (
    <View style={styles.column} {...layoutProps}>
      <Text style={styles.columnName}>{item.name}</Text>
      {columnComponent}
    </View>
  );
};

IMPORTANT: You need pass layoutProps to wrapper view props and columnComponent must be rendered inside renderColumnWrapper fuction.

See example for more details.

Performance

We're trying to improve board performance. If you have a better solution, please open a issue or pull request. Best regards!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].