vue-fluid-dnd
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

Icon
Vue Fluid DnD

npm bundle size license version GitHub issues GitHub stars twitter test_coverage

A fluid, smooth and versatil drag and drop library for lists on Vue3. It's a lightweight tool ~7 Kb (gzip) with no depenencies.

✨ Features

  • Fully customizable 🎨.
  • Zero dependencies 🪶.
  • Work with horizontal➡️and vertical list ⬇️.
  • Mouse 🐭 and touch 👉📱 (mobile, tablet and so on) support.
  • Nice documentation 📑 and examples.
  • Fully tested 🧪, typed and reliable.

🚀 Getting Started

  1. 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
  2. Import the vue composable

    import { useDragAndDrop } from "vue-fluid-dnd";
  3. 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);
  4. 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>
  5. Documentation

  • 📚 Check out all the docs.
  • 🛠️ Edit the previous here.
  • 📘 See others examples here.

🤝 Contributing

If you're interested in contributing to vue-fluid-dnd, please read our contributing docs before submitting a pull request CONTRIBUTING.

🔑 License

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.7.049latest

Version History

VersionDownloads (Last 7 Days)Published
0.7.049
0.6.192
0.6.180
0.6.170
0.6.160
0.6.150
0.6.1411
0.6.130
0.6.121
0.6.111
0.6.100
0.6.90
0.6.80
0.6.70
0.6.60
0.6.51
0.6.43
0.6.30
0.6.20
0.6.10
0.6.00
0.5.31
0.5.20
0.5.10
0.5.00
0.4.121
0.4.110
0.4.100
0.4.90
0.4.80
0.4.70
0.4.60
0.4.50
0.4.40
0.4.30
0.4.20
0.4.10
0.1.281
0.1.260
0.1.250
0.1.230
0.1.220
0.1.211
0.1.200
0.1.190
0.1.180
0.1.170
0.1.160
0.1.150

Package Sidebar

Install

npm i vue-fluid-dnd

Weekly Downloads

72

Version

0.7.0

License

none

Unpacked Size

66.5 kB

Total Files

25

Last publish

Collaborators

  • carlosjorger