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

react-edge-dock

v1.0.11

Published

A zero-dependency React TypeScript library for customizable draggable edge-docked floating buttons with popup support

Downloads

1,064

Readme

react-edge-dock

A zero-dependency React + TypeScript library for customizable draggable edge-docked floating buttons with popup support.

Features

  • 🎯 Zero dependencies (React only)
  • 🎨 Fully customizable and headless
  • 📱 Touch and pointer event support
  • 🎬 Smooth animations with spring physics
  • 📦 TypeScript first with full type safety
  • 🎮 Multiple docking modes (free, auto, manual)
  • 💡 Smart popup positioning
  • ⚡ Performance optimized with transform: translate3d
  • 🌐 SSR compatible (Next.js, Remix, etc.)
  • 📏 Configurable edge offset/margin

Installation

npm install react-edge-dock

Quick Start

import { EdgeDock } from 'react-edge-dock';

function App() {
  return (
    <EdgeDock
      dockMode="auto"
      animation={true}
      edgeOffset={16} // 16px gap from screen edge
      button={<button>🚀</button>}
      popup={<div>Your content here</div>}
    />
  );
}

Usage in Next.js

Works out of the box with Next.js App Router and Pages Router:

'use client'; // For App Router

import { EdgeDock } from 'react-edge-dock';

export default function MyComponent() {
  return (
    <EdgeDock
      dockMode="auto"
      edgeOffset={20}
      button={<button>Menu</button>}
      popup={<div>Navigation</div>}
    />
  );
}

Configuration

  • dockMode: "free" | "auto" | "manual" - Docking behavior
  • dockEdge: "left" | "right" | "top" | "bottom" - Fixed edge (manual mode)
  • allowedEdges: DockEdge[] - Restrict docking to specific edges (e.g., ['left', 'right'] for horizontal only)
  • edgeOffset: number | { left?: number; right?: number; top?: number; bottom?: number } - Gap from edges in pixels
  • animation: boolean - Enable snap animations
  • popupGap: number - Gap between button and popup
  • position: { x: number; y: number } - Initial/controlled position
  • zIndex: number - z-index for the dock
  • onDockChange: Callback when dock state changes
  • isPopupOpen / onPopupChange: Controlled popup state

Examples

Same offset for all edges

<EdgeDock
  dockMode="auto"
  edgeOffset={16}
  button={<button>🚀</button>}
/>

Different offset for each edge

<EdgeDock
  dockMode="auto"
  edgeOffset={{ left: 10, right: 20, top: 15, bottom: 25 }}
  button={<button>🎯</button>}
/>

Restrict to horizontal edges only (left/right)

<EdgeDock
  dockMode="auto"
  allowedEdges={['left', 'right']}
  edgeOffset={{ left: 16, right: 24 }}
  button={<button>📱</button>}
/>

Restrict to vertical edges only (top/bottom)

<EdgeDock
  dockMode="auto"
  allowedEdges={['top', 'bottom']}
  button={<button>⬆️</button>}
/>

Manual edge with offset

<EdgeDock
  dockMode="manual"
  dockEdge="right"
  edgeOffset={{ right: 20 }}
  button={<button>➡️</button>}
/>

API

See the example.tsx file for more detailed usage examples.