Draggable List Sorter In Vanilla JavaScript – Sorter

Category: Drag & Drop , Javascript | June 9, 2021
Author: alsolovyev
Views Total: 38 views
Official Page: Go to website
Last Update: June 9, 2021
License: MIT

Preview:

Draggable List Sorter In Vanilla JavaScript – Sorter

Description:

Sorter is a tiny sortable JavaScript library that allows drag & drop sorting of list items.

How to use it:

1. Install & download.

# NPM
$ npm i @alsolovyev/sorter --save

2. Import the Sorter’s JavaScript into the document.

<script src="/dist/sorter.min.js"></script>
// OR
import Sorter from '@alsolovyev/sorter'

3. Initialize the sorter on your list and the library will do the rest.

<ul data-list>
  <li><span><span><i>1</i></span></span></li>
  <li><span><span><i>2</i></span></span></li>
  <li><span><span><i>3</i></span></span></li>
  <li><span><span><i>4</i></span></span></li>
  <li><span><span><i>5</i></span></span></li>
  <li><span><span><i>6</i></span></span></li>
  <li><span><span><i>7</i></span></span></li>
  <li><span><span><i>8</i></span></span></li>
</ul>

You Might Be Interested In:


Leave a Reply