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

@arthur5005/dnd-kit-ember

v0.1.2

Published

Ember addon for drag and drop powered by @dnd-kit/dom

Readme

dnd-kit-ember

An Ember addon providing drag and drop functionality powered by @dnd-kit/dom.

Live Demo

Early Development Warning: This is an experimental addon with no tests. It is intended as an exploration for replacing ember-sortable. The API is subject to change. Use at your own risk.

Installation

pnpm add @arthur5005/dnd-kit-ember

Requirements

  • Ember 5.0+
  • GJS/GTS only - This addon only supports strict mode templates (.gjs/.gts files)
  • Embroider - This is a v2 addon and requires an Embroider-compatible build pipeline

Usage

Draggable and Droppable

import DragDrop from '@arthur5005/dnd-kit-ember/components/drag-drop';
import type { DragDropEvents } from '@arthur5005/dnd-kit-ember';

function handleDragEnd(event: Parameters<DragDropEvents['dragend']>[0]) {
  if (event.canceled) return;

  const sourceId = event.operation.source?.id;
  const targetId = event.operation.target?.id;
  // Handle the drop
}

<template>
  <DragDrop @onDragEnd={{handleDragEnd}} as |dd|>
    <div {{dd.draggable id="item-1"}}>
      Drag me
    </div>

    <div {{dd.droppable id="drop-zone"}}>
      Drop here
    </div>
  </DragDrop>
</template>

Type-Restricted Drop Zones

<template>
  <DragDrop @onDragEnd={{handleDragEnd}} as |dd|>
    <div {{dd.draggable id="circle-1" type="circle"}}>Circle</div>
    <div {{dd.draggable id="square-1" type="square"}}>Square</div>

    <div {{dd.droppable id="circles-only" accept="circle"}}>
      Only accepts circles
    </div>
  </DragDrop>
</template>

Sortable List

The sortable modifier combines draggable and droppable behavior for reorderable lists.

Note: dnd-kit's sortable is an optimistic sorter - items visually reorder as you drag over them. You must handle @onDragStart, @onDragOver, and @onDragEnd to maintain state and support cancellation (e.g., pressing Escape).

import { tracked } from '@glimmer/tracking';
import DragDrop from '@arthur5005/dnd-kit-ember/components/drag-drop';
import { move } from '@dnd-kit/helpers';
import type { DragDropEvents } from '@arthur5005/dnd-kit-ember';

class State {
  @tracked items = ['Item 1', 'Item 2', 'Item 3', 'Item 4'];
  @tracked snapshot: string[] = [];
}

const state = new State();

function handleDragStart() {
  // Save snapshot for cancellation
  state.snapshot = [...state.items];
}

function handleDragOver(event: Parameters<DragDropEvents['dragover']>[0]) {
  // Optimistically reorder items as we drag
  state.items = move(state.items, event);
}

function handleDragEnd(event: Parameters<DragDropEvents['dragend']>[0]) {
  if (event.canceled) {
    // Restore snapshot if cancelled (e.g., Escape key)
    state.items = [...state.snapshot];
  }
}

<template>
  <DragDrop
    @onDragStart={{handleDragStart}}
    @onDragOver={{handleDragOver}}
    @onDragEnd={{handleDragEnd}}
    as |dd|
  >
    <ul>
      {{#each state.items as |item index|}}
        <li {{dd.sortable id=item index=index}}>
          {{item}}
        </li>
      {{/each}}
    </ul>
  </DragDrop>
</template>

Sortable with Drag Handles

<template>
  <DragDrop
    @onDragStart={{handleDragStart}}
    @onDragOver={{handleDragOver}}
    @onDragEnd={{handleDragEnd}}
    as |dd|
  >
    <ul>
      {{#each state.items as |item index|}}
        <li {{dd.sortable id=item index=index}}>
          <span {{dd.handle}}>⠿</span>
          {{item}}
        </li>
      {{/each}}
    </ul>
  </DragDrop>
</template>

API

DragDrop Component

The main component that sets up the drag and drop context.

| Argument | Type | Description | |----------|------|-------------| | @sensors | Sensor[] | Custom sensors for drag detection | | @plugins | Plugin[] | DnD Kit plugins | | @modifiers | Modifier[] | DnD Kit modifiers | | @onBeforeDragStart | function | Called before drag starts | | @onDragStart | function | Called when drag starts | | @onDragMove | function | Called on drag movement | | @onDragOver | function | Called when dragging over a droppable | | @onDragEnd | function | Called when drag ends | | @onCollision | function | Called on collision detection |

Yielded modifiers:

  • draggable - Makes an element draggable (required: id)
  • droppable - Makes an element a drop target (required: id)
  • sortable - Combines draggable/droppable for sortable lists (required: id, index)
  • handle - Designates a drag handle within a draggable or sortable

Each modifier accepts additional options from dnd-kit. See the dnd-kit documentation for the full list of available options.

Learn More

For detailed documentation on dnd-kit's features, sensors, plugins, and modifiers, see the dnd-kit documentation.

License

MIT