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

@pyreon/dnd

v0.12.7

Published

Signal-driven drag and drop for Pyreon — wraps @atlaskit/pragmatic-drag-and-drop

Readme

@pyreon/dnd

Signal-driven drag and drop for the Pyreon framework. Wraps @atlaskit/pragmatic-drag-and-drop with reactive signal state.

Install

bun add @pyreon/dnd

Features

  • 5 hooks covering all drag-and-drop use cases
  • Signal-driven state (isDragging, isOver, activeId, etc.)
  • Auto-scroll when dragging near container edges
  • Closest-edge detection for precise drop indicators
  • Keyboard accessibility (Alt+Arrow to reorder)
  • File drop with MIME type and count filtering
  • Global drag monitoring for overlays and analytics

Hooks

useDraggable

Make an element draggable with reactive state.

const { isDragging } = useDraggable({
  element: () => cardEl,
  data: { id: card.id, type: "card" },
  handle: () => handleEl,   // optional drag handle
  disabled: () => locked(),  // reactive disable
})

<div ref={(el) => cardEl = el} class={isDragging() ? "opacity-50" : ""}>
  <div ref={(el) => handleEl = el}>⠿</div>
  {card.title}
</div>

useDroppable

Make an element a drop target with filtering.

const { isOver } = useDroppable({
  element: () => zoneEl,
  canDrop: (data) => data.type === "card",
  onDrop: (data) => addCard(data.id),
  onDragEnter: () => highlight(),
  onDragLeave: () => unhighlight(),
})

<div ref={(el) => zoneEl = el} class={isOver() ? "bg-blue-50" : ""}>
  Drop here
</div>

useSortable

Full-featured sortable list with edge detection and keyboard support.

const { containerRef, itemRef, activeId, overId, overEdge } = useSortable({
  items: columns,
  by: (col) => col.id,
  onReorder: (newItems) => columns.set(newItems),
  axis: "vertical",  // or "horizontal"
})

<ul ref={containerRef}>
  <For each={columns()} by={c => c.id}>
    {col => (
      <li
        ref={itemRef(col.id)}
        class={activeId() === col.id ? "dragging" : ""}
        style={overId() === col.id && overEdge() === "top" ? "border-top: 2px solid blue" : ""}
      >
        {col.name}
      </li>
    )}
  </For>
</ul>

Features:

  • Auto-scroll when dragging near container edges
  • overEdge signal shows "top"/"bottom" (vertical) or "left"/"right" (horizontal)
  • Keyboard reordering with Alt+Arrow keys
  • Accessible: role="listitem", aria-roledescription, tabindex

useFileDrop

Native file drag-and-drop with filtering.

const { isOver, isDraggingFiles } = useFileDrop({
  element: () => dropZone,
  accept: ["image/*", ".pdf"],
  maxFiles: 5,
  onDrop: (files) => upload(files),
  disabled: () => uploading(),
})

<div
  ref={(el) => dropZone = el}
  class={isOver() ? "drop-active" : isDraggingFiles() ? "drop-ready" : ""}
>
  {isDraggingFiles() ? "Drop files here" : "Drag files to upload"}
</div>

useDragMonitor

Global drag state tracking for overlays and coordination.

const { isDragging, dragData } = useDragMonitor({
  canMonitor: (data) => data.type === "card",
  onDragStart: (data) => showOverlay(),
  onDrop: (source, target) => logAnalytics(source, target),
})

<Show when={isDragging()}>
  <div class="global-drag-overlay">
    Dragging: {() => dragData()?.name}
  </div>
</Show>

License

MIT