Create nestable lists that can be sorted by drag and drop.

The Nestable allows you to sort items through drag and drop. This is great, if you want to organize different categories or menu items in administration areas, for example.


A nestable list consists of the list itself and its items, a handle and a toggle.

Class/Data attribute Description
.nestable Add this class to a <ul> element to define the component.
data-nestable To enable the necessary JavaScript, just add this data attribute.
.nestable-item Add this class to a <div> element inside each list item.
.nestable-handle This class creates the handle to enable drag and drop sorting.
data-nestable-action="toggle" This data attribute allows you to hide or show nested list items.


  • Item 1
  • Item 2
  • Item 3


<ul class="nestable" data-nestable>
        <div class="nestable-item">
            <div class="nestable-handle"></div>
            <div data-nestable-action="toggle"></div>

Sort multiple lists

To be able to sort items from one list to another, you can group them by adding the data-nestable="{group:'GROUP-NAME'}" attribute to each list. By default, lists without any group name are automatically in the same group.


  • Item 1
  • Item 2
  • Item 3

Second list

  • Item 4


<ul class="nestable" data-nestable="{group:'my-group'}">...</ul>
<ul class="nestable" data-nestable="{group:'my-group'}">...</ul>

Disable nesting

To disable nesting of list items, just add the data-nestable="{maxDepth:1}" attribute. You can also use this data attribute to determine to what depth nesting is possible.

  • Item 1
  • Item 2
  • Item 3


<ul class="nestable" data-nestable="{maxDepth:1}">...</ul>

JavaScript options

This is an example of how to set options via attribute:

data-nestable="{maxDepth:0, group:'widgets'}"
Option Possible value Default Description
group integer (0..6) 0 List group
maxDepth integer 10 Max nesting level

Init element manually

var nestable = Clique.nestable(element, {
    /* options */


Name Parameter Description
start.clique.nestable event, nestable object On nestable drag start
move.clique.nestable event, nestable object On nestable move item
stop.clique.nestable event, nestable object On nestable stop dragging
change.clique.nestable event, nestable item, action On nestable change item