TypeScript Drag and Drop

Open-source TypeScript projects categorized as Drag and Drop

Top 23 TypeScript Drag and Drop Projects

  • react-dnd

    Drag and Drop for React

    Project mention: Developing and testing sortable Drag and Drop components. Part 1 - Development. | dev.to | 2022-12-04

    React DnD.

  • GrapesJS

    Free and Open source Web Builder Framework. Next generation tool for building templates without coding

    Project mention: Looking for flow builder like reactflow | reddit.com/r/webdev | 2023-02-18

    Take a look at grapesjs ( https://github.com/GrapesJS/grapesjs) . . . With a bit of work u can make a pretty good editor using it. For reference u can check out something like poweredit (https://github.com/anatoli-dp/poweredit) that uses it (I am aware it is a pretty poor example.domt hate me but it was my first take at using the framework and making an application) as well as quite a few others. But it does have a lot to use as a starting point for your own

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • interact.js

    JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)

    Project mention: How to create a Drag and Drop quiz like this? | reddit.com/r/webdev | 2022-11-14

    For vanilla js maybe something like https://shopify.github.io/draggable/ or https://interactjs.io/

  • Konva

    Konva.js is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.

    Project mention: Any Ideas How to Create a Graph Builder UI in React? | reddit.com/r/reactjs | 2023-01-24

    used goJS in one project and konva in another

  • dnd-kit

    The modern, lightweight, performant, accessible and extensible drag & drop toolkit for React.

    Project mention: Making an accordion sortable. | reddit.com/r/reactjs | 2023-03-30
  • craft.js

    🚀 A React Framework for building extensible drag and drop page editors

    Project mention: Where to start building a low-code tool | reddit.com/r/react | 2023-03-07

    https://craft.js.org/ - This is probably more like what you're looking for. It's in heavy development still and does lack some features but you can use it with reactive components.

  • nocobase

    NocoBase is a scalability-first, open-source no-code/low-code platform to build internal tools.

    Project mention: Minimalist Ticketing System | reddit.com/r/selfhosted | 2023-02-23

    How about just clicking something together using a no-code tool like https://github.com/nocobase/nocobase or https://www.tooljet.com/ ?

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • react-email-editor

    Drag-n-Drop Email Editor Component for React.js

    Project mention: Sending Emails with ReactJS | dev.to | 2022-09-20

    import React from 'react'; export default class extends React.Component { constructor(props) { super(props); this.state = { feedback: '', name: 'Name', email: '[email protected]' }; this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); } render() { return ( Let's see if it works ) } handleChange(event) { this.setState({feedback: event.target.value}) } handleSubmit() { } }

    Enter fullscreen mode Exit fullscreen mode

    Now we need to add a handleSubmit() function to our component to call sendFeedback() function that will, as a result, trigger email sending via EmailJS. To keep it simple, we’ll use the default emailjs.send function.

    handleSubmit (event) {
        const templateId = 'template_id';
        this.sendFeedback(templateId, {message_html: this.state.feedback, from_name: this.state.name, reply_to: this.state.email})
      }
      sendFeedback (templateId, variables) {
        window.emailjs.send(
        'gmail', templateId,
        variables
        ).then(res => {
            console.log('Email successfully sent!')
        })
        // Handle errors here however you like, or use a React error boundary
        .catch(err => console.error('Oh well, you failed. Here some thoughts on the error that occured:', err))
      }
    
    Enter fullscreen mode Exit fullscreen mode

    Replace the function parameters with your own and test if everything went smoothly in the EmailJS dashboard.

    Don’t forget to import and use your Form component from the main component of your application which is located at src/App.js.

    Image description

    That’s all! Went pretty smoothly, huh?

    Setting up an Express backend and connecting 3rd parties

    If EmailJS won’t work for your use case, there’s an option to set up your own backend quickly and connect the 3rd party tool for email sending. As mentioned in the beginning of this article, ReactJS itself doesn’t have sending capabilities.

    The set up is very easy. This guide takes you step by step through the steps required to quickly build an Express Node.js backend.

    Once you have the backend, it’s time to connect a service specializing in sending emails. Follow this example to see how Mailjet can be implemented with your Express backend. Of course, many other tools such as SendGrid, Sendinblue or Mandrill can be implemented too thanks to their APIs. Please refer to their documentation for more details.

    As you can see, this approach is fairly quick to set up and will do its job for basic things, such as most contact forms. Since emails sent this way land usually in your inboxes, you don’t care much about formatting and styles. If the email workflow you just added is meant for the user’s inbox (for example, a newsletter confirmation form), you probably want to beautify the message a little bit. Let’s talk about how to do it.

    Building an HTML template in ReactJS

    As you know, ReactJS projects are built using reusable components, pieces of UI that can be grouped with one another and placed around web pages with almost no effort. To no surprise, building an email template in React works in exactly the same fashion.

    If you’ve ever tried to build and deliver emails with any framework, you know how painful it can be. What looks great on your testing environment, might render as a completely random set of styles and copy on users’ devices. Many browsers recognize tags but others will omit them. Others work with inline styles but, again – not all of them. As a result, even if you test your emails inside out, possibly something is bound to go wrong.

    One tool that aims to prevent such troubles is Mjml. It’s a markup language that makes it easy to generate fully-responsive HTML templates. It comes with a large set of frequently used components that can be inserted in your mailings without coding them from scratch.

    Another really useful tool you can use is React-html-email. It’s used to quickly build reusable components of your choice. You insert your code sample, however long it is, and immediately get a single-line code component you can use throughout the project. See the example below:

    import React from 'react';
    import { Email, Item, A} from 'react-html-email';
    export default function InlineLink({name, children}) {
      return (
      
        
           Hello {name}
           Click me!
        
        
          {children}
        
      
    )};
    
    Enter fullscreen mode Exit fullscreen mode

    Add the code from above to a file in your client project to src directory and call it Email.js. Don’t forget to add react-html-email component to your project. Then import this component to client/src/Form.js and renderEmail from react-html-email to client/src/Form.js.

    import MyEmail from './Email'
    import { renderEmail } from 'react-html-email'
    
    Enter fullscreen mode Exit fullscreen mode

    After that you can use the following line to generate HTML code of your message:

    const messageHtml =  renderEmail(); // HTML code
    
    Enter fullscreen mode Exit fullscreen mode

    React-html-email comes with an email validator that immediately checks and informs you if there were any errors in the component’s code.

    There’s also a really interesting WYSIWYG email editor for React with drag & drop features, aptly known as React Email Editor. Check it out and see if it can accelerate your development.

    Finally, whether you use these tools or not, there’s a bunch of tips to take into consideration when trying to build a responsive email template. This article makes for a fairly compelling source.

    Sending emails with Nodemailer

    Now, let’s assume we want to use Nodemailer to build a backend for our React email client. It’s perfectly doable and not so hard to set up.

    Nodemailer is a go-to module for anyone needing to send emails with Node.js framework. If you followed the example above, you should have already both Create-React-App and Express server set up. If you don’t, do it before we start as we’ll be using both.

    In this example, we’ll refer to a web form you could add to your website, for example, to let customers reach out quickly to your sales and support teams. Start off with building the UI of such form in ReactJS. Need some inspiration? Check out this list of 45 ready-to-implement React forms.

    Now, add the code to handle the form submissions. There are tons of parameters that can be used with Nodemailer, review them here and add according to your needs. Here’s an example:

    handleSubmit(event){
    const messageHtml =  renderEmail(
       {this.state.feedback}
    );
            axios({
                method: "POST",
                url:"http://localhost:3000/send",
                data: {
            name: this.state.name,
            email: this.state.email,
            messageHtml: messageHtml
                }
            }).then((response)=>{
                if (response.data.msg === 'success'){
                    alert("Email sent, awesome!");
                    this.resetForm()
                }else if(response.data.msg === 'fail'){
                    alert("Oops, something went wrong. Try again")
                }
            })
        }
    
    Enter fullscreen mode Exit fullscreen mode

    Add axios to your client application. In express_react_example/client run:

    npm install axios --save
    
    Enter fullscreen mode Exit fullscreen mode

    And add the import to the

    express_react_example/client/Form.js:

    import axios from ‘axios’;
    
    Enter fullscreen mode Exit fullscreen mode

    Make sure you reset the form once a message is submitted, in case a user wants to send another one.

    resetForm(){
            this.setState({feedback: ''});
        }
    
    Enter fullscreen mode Exit fullscreen mode

    Now, it’s about time we add Nodemailer to our project (the backend part):

    npm install nodemailer --save
    
    Enter fullscreen mode Exit fullscreen mode

    and create a config file to store the credentials of an account we’re going to use. We’re adding it to the backend so there are no security concerns this time. Put this file next to your server source code and call it config.js.

    module.exports = {
        USER: 'YOUR_EMAIL_ADDRESS',
        PASS: 'PASSWORD_FOR_EMAIL'
    }
    
    Enter fullscreen mode Exit fullscreen mode

    Then, we’ll want to set up the transporter to deliver our messages. Nodemailer can be used with different types of transporters. We recommend the default one, referred to as SMTP transporter, due to the simplicity of installation and its reliability. If you’re not happy with it, you can also integrate other transporters with your Nodemailer campaign. We’ll stick with the default one here.

    First of all, we need to share our credentials with the SMTP transporter. Add the following code to your server source code which should be called server.js if you followed the Express.js setup instructions:

    const nodemailer = require('nodemailer');
    const creds = require('./config');
    var transport = {
      host: 'your_host_here', // e.g. smtp.gmail.com
      auth: {
        user: creds.USER,
        pass: creds.PASS
      }
    }
    var transporter = nodemailer.createTransport(transport)
    transporter.verify((error, success) => {
      if (error) {
        console.log(error);
      } else {
        console.log('All works fine, congratz!');
      }
    });
    
    Enter fullscreen mode Exit fullscreen mode

    Once done, we set up the post route to take our emails to its final destination – our inbox!

    app.use(express.json()); app.post('/send', (req, res, next) => {
      const name = req.body.name
      const email = req.body.email
      const message = req.body.messageHtml
      var mail = {
        from: name,
        to: 'RECEIVING_EMAIL_ADDRESS_GOES_HERE',
        subject: 'Contact form request',
        html: message
      }
      transporter.sendMail(mail, (err, data) => {
        if (err) {
          res.json({
            msg: 'fail'
          })
        } else {
          res.json({
            msg: 'success'
          })
        }
      })
    })
    
    Enter fullscreen mode Exit fullscreen mode

    Now run the backend by running the following command in the root of your application:

    node server.js
    
    Enter fullscreen mode Exit fullscreen mode

    And run the frontend part too by running the command at the client directory:

    npm start
    
    Enter fullscreen mode Exit fullscreen mode

    All done! You should receive an email, the form will reset and a user should see the confirmation you added in your React project.

    Image description


    Summary
    We’ve tried to summarize various methods that can be used to send emails in ReactJS. Given how powerful and useful React is for nearly all kinds of projects, you don’t want to get stuck on something as simple as form submission. By all means, try them all and see which fits best for your project. Best of luck!

    I hope you enjoyed our tutorial on how to send emails with attachments via ReactJS that was originally published on Mailtrap Blog.

  • react-sortablejs

    React bindings for SortableJS

    Project mention: Drag and Drop - Which library? | reddit.com/r/reactjs | 2022-05-13

    react-sortablejs: Uses the native HTML DND backend. Also not "production ready".

  • react-smooth-dnd

    react wrapper components for smooth-dnd

  • Silex

    Silex hackable website builder (by silexlabs)

    Project mention: Creating an offline version of something ArcGIS StoryMaps-adjacent | reddit.com/r/gis | 2022-12-02

    I'm using a combination of Silex and ArcGIS Pro. Using Javascript event handlers helps make it interactive. In Pro I opted to not georeference my historical map (it was way too messy) and instead created shapefiles for each historical kingdom on a modern basemap. When I'm done I'll zip the website files and send it on to my prof.

  • HTML5Sortable

    VanillaJS sortable lists and grids using native HTML5 drag and drop API.

  • dflex

    The sophisticated Drag and Drop library you've been waiting for 🥳

    Project mention: DFlex – The JavaScript Library for Modern Drag and Drop Apps | news.ycombinator.com | 2022-09-21
  • react-movable

    🔀 Drag and drop for your React lists and tables. Accessible. Tiny.

    Project mention: Drag and Drop - Which library? | reddit.com/r/reactjs | 2022-05-13

    react-movable: Seems to do the job but the user count is lower than the one of dnd-kit.

  • neodrag

    One Draggable to rule them all 💍

    Project mention: Neodrag: An SSR-friendly, multi-framework draggable library | reddit.com/r/sveltejs | 2023-01-12

    Also about the stutter on mobile, can you upgrade to v2 and try? It might have been fixed. If not, feel free to open an issue https://github.com/PuruVJ/neodrag/issues

  • FlexLayout

    A multi-tab layout manager (by caplin)

    Project mention: How to Build Resizeable Panels Like Tailwind | reddit.com/r/reactjs | 2022-05-30
  • react-sortable-pane

    :sparkles: A sortable and resizable pane component for React.

  • smooth-dnd

    drag and drop library for javascript

    Project mention: What does "ghost" mean in the smooth-dnd library? | reddit.com/r/learnjavascript | 2022-10-28

    I'm working on a Vue project and I wanted nice drag and drop functionality, which led me to vue-smooth-dnd which is just a wrapper around smooth-dnd.

  • dnd

    Beautiful and accessible drag and drop for lists with React.

    Project mention: Drag and Drop for React 18 | reddit.com/r/reactjs | 2023-02-15
  • angular-editor-fabric-js

    Drag-and-drop editor based on Fabricjs for Angular.io

  • react-complex-tree

    Unopinionated Accessible Tree Component with Multi-Select and Drag-And-Drop

    Project mention: I'm building react-complex-tree, an unopinionated tree component for react, and recently released a new version! | reddit.com/r/reactjs | 2022-12-08

    You can find the source code for it at https://github.com/lukasbach/react-complex-tree, and documentation and examples at https://rct.lukasbach.com

  • angular-grid-layout

    Responsive grid with draggable and resizable items for Angular applications.

    Project mention: Angular Grid Layout v2.0.0 published! 🚀 With custom-placeholder and grid-gap as new features | reddit.com/r/Angular2 | 2022-09-22
  • react-dnd-treeview

    A draggable / droppable React-based treeview component. You can use render props to create each node freely.

  • Sonar

    Write Clean JavaScript Code. Always.. Sonar helps you commit clean code every time. With over 300 unique rules to find JavaScript bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-03-30.

TypeScript Drag and Drop related posts

Index

What are some of the best open-source Drag and Drop projects in TypeScript? This list will help you:

Project Stars
1 react-dnd 19,016
2 GrapesJS 17,654
3 interact.js 11,429
4 Konva 9,026
5 dnd-kit 7,369
6 craft.js 5,643
7 nocobase 4,090
8 react-email-editor 3,778
9 react-sortablejs 1,670
10 react-smooth-dnd 1,658
11 Silex 1,561
12 HTML5Sortable 1,536
13 dflex 1,519
14 react-movable 1,323
15 neodrag 1,060
16 FlexLayout 680
17 react-sortable-pane 627
18 smooth-dnd 537
19 dnd 486
20 angular-editor-fabric-js 368
21 react-complex-tree 348
22 angular-grid-layout 324
23 react-dnd-treeview 319
Write Clean JavaScript Code. Always.
Sonar helps you commit clean code every time. With over 300 unique rules to find JavaScript bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.
www.sonarsource.com