Awesome
<h1 align="center"> <img src="https://github.com/carlosjorger/vue-fluid-dnd/assets/50055316/dab15832-5290-42ca-b425-db177a2e589e" alt="Icon" width="150" height="140" /> <br>Vue Fluid DnD<br> </h1> <div align="center"> </div>Vue Fluid DnD is a fluid, smooth and versatil drag and drop library for lists on Vue 3. It's alightweight tool ~7 Kb (gzip) with no depenencies. This library is a Vue Draggable Next alternative if you looking for a better ui experience.
<img src="https://github.com/carlosjorger/vue-fluid-dnd/assets/50055316/4b25fd5e-4815-4a24-afe4-6f41d34be820" width="100%"/>π§° Features
- β Fully customizable π¨.
- β Zero dependencies πͺΆ.
- β Work with horizontalβ‘οΈand vertical list :arrow_down:.
- β Mouse π and touch ππ± (mobile, tablet and so on) support.
- β Nice documentation π and examples.
- β Fully tested π§ͺ, typed and reliable.
β¨ Inspirations
- β π₯ Animations by react-beautiful-dnd
- β π¨ Api by Drag & Drop by Formkit
- β π§° Features by Vue.Draggable
π Getting Started
-
Install vue-fluid-dnd:
# with npm: npm i vue-fluid-dnd # with yarn: yarn add vue-fluid-dnd # with pnpm: pnpm i vue-fluid-dnd
-
Import the vue composable
import { useDragAndDrop } from "vue-fluid-dnd";
-
Create a list that your want to sort an use useDragAndDrop
// Each element have its own styles or classes and the draggable-id const listToSort = ref([ { number: 1, style: "color: white; background-color: red; width: 50px; margin: 23px 0;", }, //... ]); // create the parent element and set drag and drop configuration on the parent and children elements (creating events, statees, styles, etc) calling useDragAndDrop composable const { parent } = useDragAndDrop(listToSort);
-
Create childrens
<template> <div ref="parent" style="width: 40%; display: block"> <div v-for="(element, index) in listToSort" :index="index" :style="element.style" >{{ element.number }} </div> </div> </template>
-
Documentation
π€ Contributing
If you're interested in contributing to vue-fluid-dnd, please read our contributing docs before submitting a pull request CONTRIBUTING.
π License
- MIT.