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-seating-arrangement

v1.0.0

Published

React library for creating and managing library seat layouts with smooth, interactive design tools

Readme

React Seating Arrangement

A powerful React library for creating and managing library seat layouts with smooth, interactive design tools. Built with D3.js, Interact.js, and Redux Toolkit.

Features

Designer Mode (Admin)

  • Seat Placement: Click to place seats (circular or square)
  • Drag & Drop: Smooth dragging of seats with D3.js
  • Zoom & Pan: Mouse wheel zoom, pan with drag
  • Export Layout: Save layouts as JSON
  • Toolbar: Quick access to tools (Select, Seat, Pen, Pan)
  • Keyboard Shortcuts: V (Select), S (Seat), P (Pen), H (Pan)

User Mode (Public)

  • Seat Selection: Click available seats to select
  • Visual Feedback: Color-coded seat status
  • Interactive Workspace: Zoom and pan support
  • Event Callbacks: Handle seat clicks and selections

Installation

npm install

Usage

Basic Example

import LibrarySeatToolkit from './components'

function App() {
  return (
    <LibrarySeatToolkit
      mode="designer"
      events={{
        onSeatClick: (seat) => {
          console.log("Seat clicked:", seat)
        },
        onExport: (data) => {
          console.log("Layout data:", data)
        }
      }}
    />
  )
}

Designer Mode

<LibrarySeatToolkit
  mode="designer"
  events={{
    onExport: async (data) => {
      // Save to backend or download
      await fetch('/api/layouts', {
        method: 'POST',
        body: JSON.stringify(data)
      })
    }
  }}
  options={{
    exportButtonText: "Save Layout"
  }}
/>

User Mode

<LibrarySeatToolkit
  mode="user"
  data={layoutData}
  events={{
    onSeatClick: (seat) => {
      // Handle seat booking
      bookSeat(seat.id)
    },
    onSeatSelectionChange: (seats) => {
      // Handle multiple seat selection
      console.log("Selected seats:", seats)
    }
  }}
  options={{
    maxSeatSelectionCount: 5
  }}
/>

Seat Status

  • Available: Green - Seat is available for booking
  • Occupied: Red - Seat is currently in use
  • Reserved: Yellow - Seat is reserved
  • Maintenance: Gray - Seat is under maintenance
  • Locked: Dark Gray - Seat is locked/unavailable

Keyboard Shortcuts (Designer Mode)

  • V - Select tool
  • S - Seat tool
  • P - Pen tool
  • H - Pan tool
  • Escape - Clear selection

Technologies

  • React 19 - UI framework
  • TypeScript - Type safety
  • D3.js - Drag, zoom, and pan interactions
  • Interact.js - Resizing capabilities
  • Redux Toolkit - State management
  • Tailwind CSS - Styling
  • Vite - Build tool

Project Structure

src/
├── components/
│   ├── designer.tsx       # Designer mode component
│   ├── user.tsx           # User mode component
│   ├── workspace/          # Workspace and seat components
│   ├── toolbar/            # Designer toolbar
│   └── operations/         # Export/import operations
├── store/                   # Redux store and reducers
├── hooks/                   # Custom React hooks
├── types/                   # TypeScript type definitions
├── utils/                   # Utility functions (D3, workspace)
└── constants/               # App constants

Development

# Start dev server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

License

MIT