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

@asunited/floor-planner

v1.0.1

Published

A plug-and-play 2D/3D floor planner React component with wall drawing, furniture, export (PNG/SVG/JSON), undo/redo and keyboard shortcuts.

Readme

asu-floorplanner

A self-contained 2D/3D floor planner React component. Drop it into any Next.js, Vite, or Create-React-App project and pass an onSave callback — no API setup required inside the package.


Install

npm install asu-floorplanner
# or
pnpm add asu-floorplanner

Quick start

import { FloorPlanner } from 'asu-floorplanner';

export default function MyPage() {
  return (
    // The parent must have a defined height
    <div style={{ height: '100vh' }}>
      <FloorPlanner
        onSave={async (data) => {
          // data = { shapes, walls, version }
          await fetch('/api/floor-plans/my-plan', {
            method: 'PUT',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify(data),
          });
        }}
      />
    </div>
  );
}

Props

| Prop | Type | Default | Description | |---|---|---|---| | onSave | (data: FloorPlanData) => Promise<void> \| void | — | Called on Ctrl+S and auto-save. If omitted, saving is disabled. | | initialData | { id, name, shapes, walls } | — | Pre-load an existing plan on mount. | | autoSaveDelay | number | 30000 | Auto-save debounce in milliseconds. | | className | string | '' | Extra CSS classes on the wrapper div. |


Load an existing plan

const plan = await fetch('/api/floor-plans/plan-1').then(r => r.json());

<FloorPlanner
  initialData={{
    id: plan.id,
    name: plan.name,
    shapes: plan.shapes,
    walls: plan.walls,
  }}
  onSave={async (data) => {
    await fetch(`/api/floor-plans/${plan.id}`, {
      method: 'PUT',
      body: JSON.stringify(data),
    });
  }}
/>

Tailwind CSS

The package uses Tailwind utility classes. Add the package path to your tailwind.config:

// tailwind.config.js
module.exports = {
  content: [
    './src/**/*.{ts,tsx}',
    './node_modules/asu-floorplanner/dist/**/*.{js,mjs}',
  ],
};

If you are not using Tailwind, import the pre-built stylesheet instead:

import 'asu-floorplanner/dist/styles.css'; // coming in v1.1

Advanced: use individual pieces

import {
  FloorPlannerCanvas,
  Toolbar,
  PropertiesPanel,
  StatusBar,
  ViewToggle,
  ExportModal,
  useFloorPlannerStore,
  useKeyboardShortcuts,
  useAutoSave,
} from 'asu-floorplanner';

export function CustomLayout() {
  const { viewMode } = useFloorPlannerStore();
  useKeyboardShortcuts();

  return (
    <div className="flex h-screen">
      <Toolbar />
      <div className="flex-1 relative">
        {viewMode === '2d' ? <FloorPlannerCanvas /> : null}
      </div>
      <PropertiesPanel />
    </div>
  );
}

Keyboard shortcuts

| Key | Action | |---|---| | V / Esc | Select tool | | R | Room (rectangle) | | W | Wall tool | | L | Line | | D | Door | | O | Window | | T | Text label | | F | Furniture | | G | Toggle grid | | S | Toggle snap | | + / - | Zoom in/out | | 0 | Reset view | | 2 / 3 | Switch 2D / 3D | | Delete | Delete selected | | Ctrl+Z | Undo | | Ctrl+Y / Ctrl+Shift+Z | Redo | | Ctrl+A | Select all | | Ctrl+S | Save (calls onSave) |


Export formats

  • PNG — raster snapshot of the 2D canvas
  • SVG — scalable vector of all shapes and walls
  • JSON — full plan data, re-importable via importData()

TypeScript types

import type { Shape, Wall, FloorPlanData, FloorPlannerProps, ToolType } from 'asu-floorplanner';

Peer dependencies

react >= 18
react-dom >= 18

All other dependencies (three.js, zustand, lucide-react, sonner, uuid, immer) are bundled.


License

UNLICENSED — private package for AS United Pte Ltd.