Update v4.2 - New components, 10+ framework guides, and quality improvements. Visit Changelog

Tailwind CSS Drag and Drop

Use Sortable.js to create drag-and-drop, reorderable lists for modern browsers and touch devices.

Requires Additional Installation

Note that this component requires the use of the third-party Sortable.js library.

Installation

  1. Install Sortable.js.

    Install Sortable.js via npm

    Terminal
                              
                                npm i sortablejs
                              
                            
  2. Add the Sortable.js JavaScript

    Include the JavaScript <script> near the end of your </body> tag:

    HTML
                              
                            

Default sortable list

Start with a single sortable list built from standard list markup.

Shared lists

Move items between connected lists by assigning them to the same shared group.

Drag handle

Restrict dragging to a dedicated handle instead of the entire list item.

Nested sortable lists

Reorder items across nested sortable levels while preserving the hierarchy.

© 2026 Preline Labs.