explaingit

sortablejs/sortable

Analysis updated 2026-06-20

31,090JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

Sortable is a JavaScript library that makes any list or grid drag-and-drop reorderable in the browser, working on both mouse and touch devices with no framework dependencies required.

Mindmap

mindmap
  root((Sortable))
    What it does
      Drag-and-drop lists
      Mouse and touch support
      No dependencies
    Features
      Ghost placeholder
      Smooth animations
      Cross-list dragging
      Clone mode
    Tech stack
      Plain JavaScript
      HTML5 Drag API
      Pointer events fallback
    Framework wrappers
      React
      Vue
      Angular
    Use cases
      Task managers
      Kanban boards
      Form builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add drag-and-drop reordering to a to-do list so users can reprioritize tasks by dragging them up or down.

USE CASE 2

Build a Kanban board where cards can be dragged between columns such as To Do, In Progress, and Done.

USE CASE 3

Create a form builder with reorderable fields that users arrange by dragging.

USE CASE 4

Allow users to drag items between two lists, for example moving options from an available list to a selected list.

What is it built with?

JavaScript

How does it compare?

sortablejs/sortabledocsifyjs/docsifyascoders/weekly
Stars31,09031,18930,976
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasyeasy
Complexity2/52/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

In plain English

Sortable is a JavaScript library that adds drag-and-drop reordering to lists and grids in a web page. The problem it solves is a common UI need: users want to rearrange items, tasks in a to-do list, columns in a dashboard, cards in a Kanban board, by picking them up with a mouse or finger and dropping them in a new position. Implementing this from scratch with the browser's raw drag-and-drop API is awkward and inconsistent across devices, especially on touch screens. Sortable handles all of that for you with a simple setup call. Under the hood, the library uses the browser's native HTML5 Drag and Drop API where available and falls back to pointer-event tracking on touch devices. You point it at any container element, a <ul>, a <div>, a grid, and it makes all direct children draggable. As the user drags an item, Sortable plays smooth CSS animations and shows a ghost placeholder where the item will land. It emits events at each stage of a drag (start, move, end, add to another list, remove from a list) so you can sync the new order to a database or update your application state. You can also configure groups of lists so items can be dragged between them, cloned rather than moved, or restricted to specific drop zones. You would use Sortable when building task management tools, file managers, playlist editors, form builders with reorderable fields, or any interface where users need to sequence or organize items visually. Because it has no dependencies, no jQuery, no React, no framework required, it fits into any project. Official wrapper packages exist for React, Vue, Angular, Knockout, Polymer, and Ember for those who prefer framework-integrated solutions. The tech stack is plain JavaScript, available on npm or via CDN, with TypeScript type definitions available separately.

Copy-paste prompts

Prompt 1
Using Sortable.js, make a ul task list drag-and-drop reorderable. When the user drops a task in a new position, log the updated order array to the console and send it to my API via fetch.
Prompt 2
Build a three-column Kanban board with Sortable.js where cards can be dragged between columns, and each drop fires a callback that saves the new column and position to my backend.
Prompt 3
Show me how to use the official Sortable React wrapper to add drag-and-drop reordering to a list of items stored in useState, updating state automatically on each drop.
Prompt 4
Set up Sortable.js so that dragging items from a sidebar clones them into a drop zone, while the original sidebar list stays unchanged.

Frequently asked questions

What is sortable?

Sortable is a JavaScript library that makes any list or grid drag-and-drop reorderable in the browser, working on both mouse and touch devices with no framework dependencies required.

What language is sortable written in?

Mainly JavaScript. The stack also includes JavaScript.

How hard is sortable to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is sortable for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub sortablejs on gitmyhub

Verify against the repo before relying on details.