A tiny utility for making tabs inside a container draggable. It emits drag, start, cancel, and end events but does not perform the actual dragging—leaving that to the consumer. The library is minimal and singleton per element. Current version is 3.0.0, released as ESM-only (breaking from v2.x). The project is maintained by bpmn-io and follows an irregular release cadence. Key differentiators: lightweight, no DOM manipulation beyond eventing, focuses solely on drag detection, and works with any tab-based layout. Alternatives like SortableJS provide full drag-and-drop out of the box.
npm install drag-tabsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a draggable tabs instance, listens to drag and cancel events, and logs the drag context.
Use import dragTabs from 'drag-tabs' instead of require().
Ensure your project uses compatible versions of min-dom and min-dash (>=5.0.0).
Migrate to ES module imports. Use an ESM-aware bundler.
Listen to the 'drag' event and rearrange the tab elements in the DOM based on context.newIndex.
Call dragger.update() instead of creating a new instance if the tabs change.
Set "type": "module" in your package.json, or use .mjs extension for your file.
Use import dragTabs from 'drag-tabs' (without curly braces).