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

batstack-draggable-grid

v0.1.0

Published

BatStack Draggable Grid for React

Readme

BatStack Draggable Grid

A powerful and flexible draggable grid component for React applications. This package provides a customizable grid system that allows for dynamic, responsive layouts with draggable elements.

Features

  • 🎯 Draggable grid elements with smooth animations
  • 📱 Responsive design with breakpoint support
  • 🎨 Customizable styling and layout
  • 🔄 Automatic gravity and collision detection
  • 🖱️ Intuitive mouse interaction
  • 📦 Built with TypeScript for type safety
  • ⚡️ Powered by Zustand for state management

Installation

# Using npm
npm install batstack-draggable-grid

# Using yarn
yarn add batstack-draggable-grid

# Using pnpm
pnpm add batstack-draggable-grid

Usage

import { Grid } from 'batstack-draggable-grid';

const MyComponent = () => {
  const elements = [
    {
      id: '1',
      gridRect: {
        // XXL breakpoint (≥1400px)
        xxl: {
          position: { col: 1, row: 1 },
          size: { colSpan: 2, rowSpan: 2 }
        },
        // XL breakpoint (≥1200px)
        xl: {
          position: { col: 1, row: 1 },
          size: { colSpan: 2, rowSpan: 2 }
        },
        // LG breakpoint (≥992px)
        lg: {
          position: { col: 1, row: 1 },
          size: { colSpan: 2, rowSpan: 2 }
        },
        // MD breakpoint (≥768px)
        md: {
          position: { col: 1, row: 1 },
          size: { colSpan: 1, rowSpan: 2 }
        },
        // SM breakpoint (≥576px)
        sm: {
          position: { col: 1, row: 1 },
          size: { colSpan: 1, rowSpan: 1 }
        }
      },
      children: <div>Your content here</div>
    }
  ];

  return (
    <div style={{ width: '100%', height: '100vh' }}>
      <Grid elements={elements} />
    </div>
  );
};

Element Configuration

Each element in the grid must be configured with the following properties:

Required Properties

  • id: string - Unique identifier for the element
  • gridRect: object - Responsive layout configuration for different breakpoints
    • xxl: GridRect - Layout for XXL screens (≥1400px)
    • xl: GridRect - Layout for XL screens (≥1200px)
    • lg: GridRect - Layout for LG screens (≥992px)
    • md: GridRect - Layout for MD screens (≥768px)
    • sm: GridRect - Layout for SM screens (≥576px)

GridRect Structure

Each breakpoint configuration (GridRect) requires:

{
  position: {
    col: number;  // Column position (1-based)
    row: number;  // Row position (1-based)
  },
  size: {
    colSpan: number;  // Number of columns to span
    rowSpan: number;  // Number of rows to span
  }
}

Optional Properties

  • children: React.ReactNode - Content to be rendered inside the grid element

Development

To run the development environment:

# Install dependencies
yarn install

# Start development server
yarn dev

This will start both the package watcher and the example application.

Building

To build the package:

yarn build

License

Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) © Beniamin Batkowski

This license allows you to:

  • Use the software for free
  • Modify the software
  • Create derivative works
  • Share the software (with attribution)

But restricts you from:

  • Using it commercially without permission

Dependencies

This package uses the following major dependencies: