Skip to main content

Sortable

Overview

The Style Kit includes classes for using HTML Sortable for creating sortable lists.

Dependencies

This plugin depends upon:

See distribution for how to include these dependencies.

Uses

Sortable lists can be useful when users should be set the order of items, such as the drawing order of map layers.

Examples

  • Item A
  • Item B
  • Item C
  • Item D
  • Item E
<ul id="sortable-1" class="bsk-list-unstyled bsk-sortable bsk-sortable-list">
  <li><i class="bsk-text-muted far fa-fw fa-bars"></i> Item A</li>
  <li><i class="bsk-text-muted far fa-fw fa-bars"></i> Item B</li>
  <li><i class="bsk-text-muted far fa-fw fa-bars"></i> Item C</li>
  <li><i class="bsk-text-muted far fa-fw fa-bars"></i> Item D</li>
  <li><i class="bsk-text-muted far fa-fw fa-bars"></i> Item E</li>
</ul>

The corresponding JavaScript for this example:

sortable('#sortable-1', {
  items: ':not(.bsk-disabled)',
  placeholderClass: 'bsk-sortable-list-placeholder'
});