Socket
Book a DemoInstallSign in
Socket

volkeno-reactjs-drag-and-drop

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

volkeno-reactjs-drag-and-drop

ReactJS Drag and Drop Component is a drag and drop page with the ability to see the end result.

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

volkeno-reactjs-drag-and-drop

This project is a drag and drop page with the ability to see the end result.

NPM JavaScript Style Guide

Install

npm install --save volkeno-reactjs-drag-and-drop

Usage

import React, { useState } from 'react'

import { VolkenoReactDnd } from 'volkeno-reactjs-drag-and-drop'
import 'volkeno-reactjs-drag-and-drop/src/index.css'

export const Example = () => {
  const [data, setData] = useState({
    
    name: 'Drag and drop',
    child: [
    {
      id: 1,
      text: 'Column 1',
      child: [],
      words: [
        {
          id: 1,
          text: 'word 1',
          column: 1
        },
        {
          id: 2,
          text: 'word 2',
          column: 1
        },
        {
          id: 3,
          text: 'word 3',
          column: 1
        },
        {
          id: 8,
          text: 'word 8',
          column: 1
        }
      ]
    },
    {
      id: 2,
      text: 'Column 2',
      child: [],
      words: [
        {
          id: 4,
          text: 'word 4',
          column: 2
        },
        {
          id: 5,
          text: 'word 5',
          column: 2
        },
        {
          id: 6,
          text: 'word 6',
          column: 2
        },
        {
          id: 7,
          text: 'word 7',
          column: 2
        }
      ]
    }
  ],
    words: [
    {
      id: 1,
      text: 'word 1',
      column: 1
    },
    {
      id: 2,
      text: 'word 2',
      column: 1
    },
    {
      id: 3,
      text: 'word 3',
      column: 1
    },
    {
      id: 4,
      text: 'word 4',
      column: 2
    },
    {
      id: 5,
      text: 'word 5',
      column: 2
    },
    {
      id: 6,
      text: 'word 6',
      column: 2
    },
    {
      id: 7,
      text: 'word 7',
      column: 2
    },
    {
      id: 8,
      text: 'word 8',
      column: 1
    }
  ]
  })
  return (
    <div>
      <VolkenoReactDnd 
      showResult={true} 
      data={data} 
      setData={setData}  
      />
    </div>
  )
}

Configuration - Props

PropertyTypeDefaultDescription
showResultbooleanfalseActivate to see the result
dataObject-object having as child: {name: string,columns: array of object having as child: {id, text, child: array, words:array}, words: array of object having as child: {id, text, colum: id of column}}
setDatafunctionvoidThe function to call to drop a word in a column.

Keywords

react drag and drop

FAQs

Package last updated on 26 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.