Sortable List Save

A web component for reorderable drag-and-drop lists on modern browsers and touch devices.

Project README

License Published on webcomponents.org

Demo and API docs

GIF

sortable-list

sortable-list is a custom element that allows you to sort an element from a list by dragging it.

<sortable-list on-sort-finish="_onSortFinish" dragging="{{dragging}}">
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</sortable-list>

...
onSortFinish(event) {
  const sortedItem = event.detail.target;
}

When using a dom-repeat you must specify which items are sortable.

<sortable-list sortable=".item">
  <dom-repeat>
    <div class="item"></div>
  </dom-repeat>
</sortable-list>

TODO:

  • Allow sort of elements with different sizes #2
Open Source Agenda is not affiliated with "Sortable List" Project. README Source: sharedlabs/sortable-list
Stars
36
Open Issues
19
Last Commit
4 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating