npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@trilbdev/bootstrap-drag-and-drop

v1.0.0

Published

Bootstrap drag and drop utility with nested list support, sortable containers, and configurable item controls.

Readme

Bootstrap Drag and Drop

A lightweight Bootstrap-based drag and sort library for reorderable, nestable, and configurable drag/drop interfaces.

Installation

npm install @trilbdev/bootstrap-drag-and-drop

Import

import BootstrapDragAndDrop from '@trilbdev/bootstrap-drag-and-drop';
import '@trilbdev/bootstrap-drag-and-drop/css';

Basic usage

<div
  data-bdd-drag="true"
  data-bdd-mode="sort"
  data-bdd-axis="y"
  data-bdd-selector=".bdd-item"
>
  <div class="card bdd-item" data-bdd-item="true">Item 1</div>
  <div class="card bdd-item" data-bdd-item="true">Item 2</div>
  <div class="card bdd-item" data-bdd-item="true">Item 3</div>
</div>

<script type="module">
  import BootstrapDragAndDrop from '@trilbdev/bootstrap-drag-and-drop';
  import '@trilbdev/bootstrap-drag-and-drop/css';

  BootstrapDragAndDrop.autoInit();
</script>

You can also create an instance manually:

import BootstrapDragAndDrop from '@trilbdev/bootstrap-drag-and-drop';

new BootstrapDragAndDrop('#sortable-list', {
  mode: 'sort',
  axis: 'y',
  selector: '.bdd-item',
  onDrop: (container, items) => {
    console.log(items.map((item) => item.textContent.trim()));
  }
});

Data attribute API

Use data-bdd-drag="true" on the sortable container and data-bdd-item="true" on each draggable child.

Supported attributes

  • data-bdd-drag="true" — enables drag behavior on the container.
  • data-bdd-mode="sort" — drag mode. Supported values: sort and move.
  • data-bdd-axis="y" — restricts movement to x, y, or both.
  • data-bdd-selector=".bdd-item" — identifies draggable children.
  • data-bdd-item="true" — marks a draggable item.
  • data-bdd-handle=".drag-handle" — optional drag handle selector.
  • data-bdd-disabled="true" — disables the area.
  • data-bdd-container="body" — constrains movement to a specific container.
  • data-bdd-block-x-axis="true" — locks horizontal movement.
  • data-bdd-block-y-axis="true" — locks vertical movement.
  • data-bdd-delay="200" — delay before drag starts.
  • data-bdd-scroll-pixels="40" — scroll distance during drag.
  • data-bdd-dragging-class="bdd-dragging" — class applied while dragging.
  • data-bdd-connected-list="#other-list" — connects drag to another list.
  • data-bdd-copy="true" — copies instead of moving items.
  • data-bdd-sorting="false" — disables sorting animations.
  • data-bdd-animation-duration="300" — animation duration in milliseconds.
  • data-bdd-item-class="bdd-item" — item class used by the sort engine.
  • data-bdd-nesting="true" — enables nested list support.
  • data-bdd-nesting-depth="3" — limits nested depth.
  • data-bdd-anchor-position="left" — sets the anchor handle position.
  • data-bdd-delete-position="top-right" — sets the delete control position.

JavaScript options

new BootstrapDragAndDrop('#sortable-list', {
  container: 'body',
  blockXAxis: false,
  blockYAxis: false,
  delay: 0,
  disabled: false,
  dragHandle: '',
  scrollPixels: 40,
  draggingClass: 'bdd-dragging',
  connectedList: null,
  copy: false,
  sorting: true,
  enterPredicate: () => true,
  animationDuration: 300,
  itemClass: 'bdd-item',
  mode: 'sort',
  axis: 'both',
  selector: '.bdd-item',
  onDrop: (container, items) => {
    console.log('New order:', items.map((item) => item.textContent.trim()));
  }
});

Styling

The package ships with a default stylesheet companion:

import '@trilbdev/bootstrap-drag-and-drop/css';

The CSS includes the default drag styling, nested list rule, placeholder state, anchored item state, and control styling.

Features

  • drag and reorder list items
  • optional copy mode
  • connected lists
  • nested drag/drop list support
  • configurable anchor and delete controls
  • Bootstrap-friendly markup and styling

License

MIT