All Projects → thisbeyond → solid-dnd

thisbeyond / solid-dnd

Licence: MIT license
A lightweight, performant, extensible drag and drop toolkit for Solid JS.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to solid-dnd

dockview
Zero dependency layout manager and builder with ReactJS support
Stars: ✭ 45 (-82.07%)
Mutual labels:  drag-and-drop, drag, drop
Gong Wpf Dragdrop
The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF
Stars: ✭ 1,669 (+564.94%)
Mutual labels:  drag-and-drop, drag, drop
KDRearrangeableCollectionViewFlowLayout
A Drag and Rearrange UICollectionView through its layout
Stars: ✭ 73 (-70.92%)
Mutual labels:  drag-and-drop, drag, drop
react-native-dnd-board
A drag and drop Kanban board for React Native.
Stars: ✭ 41 (-83.67%)
Mutual labels:  drag-and-drop, drag, drop
DragDropiOS
DragDropiOS is a drag and drop manager on iOS. It supports drag and drop with in one or more classes extends UIView. This library contains UICollectionView and UITableView that implenment of drag and drop manager.
Stars: ✭ 71 (-71.71%)
Mutual labels:  drag-and-drop, drag, drop
KanbanDragDropiOS
Kanban Board using Drag & Drop iOS API
Stars: ✭ 95 (-62.15%)
Mutual labels:  drag-and-drop, drag, drop
Kddraganddropcollectionview
This component allows for the transfer of data items between collection views through drag and drop
Stars: ✭ 476 (+89.64%)
Mutual labels:  drag-and-drop, drag, drop
rc-dock
Dock Layout for React Component
Stars: ✭ 318 (+26.69%)
Mutual labels:  drag-and-drop, drag, drop
Angular Skyhook
An implementation of react-dnd for Angular.
Stars: ✭ 146 (-41.83%)
Mutual labels:  drag-and-drop, drag, drop
image-uploader
Simple Drag & Drop image uploader plugin to static forms, without using AJAX
Stars: ✭ 70 (-72.11%)
Mutual labels:  drag-and-drop, drag, drop
Ng2 Dnd
Angular 2 Drag-and-Drop without dependencies
Stars: ✭ 861 (+243.03%)
Mutual labels:  drag-and-drop, drag, drop
React Smooth Dnd
react wrapper components for smooth-dnd
Stars: ✭ 1,560 (+521.51%)
Mutual labels:  drag-and-drop, drag, drop
drop
A LÖVE visualizer and music player
Stars: ✭ 17 (-93.23%)
Mutual labels:  drag-and-drop, drag, drop
Vue Smooth Dnd
Vue wrapper components for smooth-dnd
Stars: ✭ 1,121 (+346.61%)
Mutual labels:  drag-and-drop, drag, drop
vue-simple-upload-component
A simple upload component for Vue.js 2.x
Stars: ✭ 14 (-94.42%)
Mutual labels:  drag-and-drop, drag, drop
Smooth Dnd
drag and drop library for javascript
Stars: ✭ 408 (+62.55%)
Mutual labels:  drag-and-drop, drag, drop
Ngx Smooth Dnd
angular wrapper for smooth-dnd
Stars: ✭ 152 (-39.44%)
Mutual labels:  drag-and-drop, drag, drop
React Beautiful Dnd
Beautiful and accessible drag and drop for lists with React
Stars: ✭ 25,810 (+10182.87%)
Mutual labels:  drag-and-drop, drag
Sortable
Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
Stars: ✭ 23,641 (+9318.73%)
Mutual labels:  drag-and-drop, drag
Silex
Silex is a static website builder in the cloud.
Stars: ✭ 958 (+281.67%)
Mutual labels:  drag-and-drop, drag

Solid DnD - A lightweight drag and drop toolkit for Solid.

  • Built for Solid: leverages fine-grained reactivity primitives for coordination.
  • Flexible: built to support a wide range of cases, from plain drag and drop to sortable lists, multiple containers and beyond.
  • Extendable: build your own sensors, collision detection algorithms and presets like sortable lists out of the primitives.
  • Zero dependencies: Just pair with Solid and good to go.
  • Performant: No component re-rendering, coupled with CSS transforms and transitions for silky smooth performance.

solid drag and drop preview

How do I get started? 🧭

Install it:

npm install @thisbeyond/solid-dnd

Use it:

import {
  DragDropProvider,
  DragDropSensors,
  useDragDropContext,
  createDraggable,
  createDroppable,
} from "@thisbeyond/solid-dnd";

const Draggable = (props) => {
  const draggable = createDraggable(props.id);
  return <div use:draggable>draggable</div>;
};

const Droppable = (props) => {
  const droppable = createDroppable(props.id);
  return <div use:droppable>droppable</div>;
};

const Sandbox = () => {
  const [, { onDragEnd }] = useDragDropContext();

  onDragEnd(({draggable, droppable}) => {
    if (droppable) {
      // Handle the drop. Note that solid-dnd doesn't move a draggable into a
      // droppable on drop. It leaves it up to you how you want to handle the
      // drop.
    }
  });

  return (
    <div>
      <Draggable id="draggable-1" />
      <Droppable id="droppable-1" />
    </div>
  );
};

const App = () => {
  return (
    <DragDropProvider>
      <DragDropSensors>
        <Sandbox />
      </DragDropSensors>
    </DragDropProvider>
  );
};

export default App;

See more examples at https://solid-dnd.com

What's implemented? ✔️

  • Use createDraggable with your elements to easily integrate drag behaviour. Maintain full control over how your element looks and behaves.
  • Manage droppable areas with createDroppable. Conditionally enable and disable droppable areas based on the current context.
  • Use DragOverlay when you want to drag a representation of your element that is removed from the normal flow.
  • Support for different sensors to detect and manage dragging (pointer sensor provided by default).
  • Layout collision detection algorithms (mostIntersecting, closestCorners and closestCenter) for common usage. You can also add your own.
  • Sortable list primitives for drag and drop list reordering (currently only vertical sorting supported).
  • Use multiple (or nested) DragDropProvider for containers isolated from each other.

Who made this?

Martin Pengelly-Phillips

Why did you make it?

Solid first caught my eye when I was looking for a way to improve performance of a React app I'd been working on. I was feeling frustrated by the rules of hooks and the effort / complexity of performance improvements - especially what felt like a lot of manual book-keeping across renders. In the end, I changed my app behaviour to sidestep the issues and carried on with React.

But I also found myself watching Solid's progress too, commenting a bit here and there in the community. So, when I started a new side project I decided to jump in and give Solid a go. Performance was great, but what kept me invested in Solid was the clean lines of its primitives / API and the incredibly helpful community. It felt quick to be productive, and I liked how there seemed to be a focus on real world problems and getting it done (progress over perfection or even a hacker spirit). Somehow it also felt closer to vanilla JS and that I was working more with the language than against it.

However, there are always tradeoffs. In this case it was that Solid was not particularly well known and there was not an ecosystem of libraries available to solve common problems. This was a double-edged sword. On the one hand I liked how writing solutions myself kept my app lean, and my solutions focused. On the other, I was spending time building these solutions rather than my app.

One of the more challenging ones was adding drag and drop sorting of list items to my app. I could have hacked in a third-party library, but I didn't want to give up the granular reactivity of Solid to do so. I was also interested in the challenge - how hard would it be with Solid? Inspired by dnd-kit (a modern approach to dnd in React), I built something out for my app in around ~700 lines. I shared a gif of it with the community and decided to try to extract it into a library for others. And so, solid-dnd came to be :)

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].