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

@jbaysolutions/floorplan-react

v2.4.0

Published

JBay Floorplan for React: floor plan editor, 2D viewer and 3D viewer components. No Vue needed in your app.

Downloads

639

Readme

@jbaysolutions/floorplan-react

Website · Live demo · Documentation

JBay Floorplan for React 18 and 19: a floor plan editor, 2D viewer and 3D viewer as React components. They are built on @jbaysolutions/floorplan-elements (installed with this package), which has Vue bundled inside; your app doesn't need Vue.

npm install @jbaysolutions/floorplan-react
npm install three   # only for the 3D viewer
import { useRef, useState } from 'react'
import { FloorplanEditor, FloorplanViewer, type FloorplanViewerElement } from '@jbaysolutions/floorplan-react'

function Building() {
  const [plan, setPlan] = useState(initialPlan)
  const [markers, setMarkers] = useState(initialMarkers)
  const viewer = useRef<FloorplanViewerElement>(null)

  return (
    <>
      <FloorplanEditor plan={plan} onChange={setPlan} style={{ height: 600 }} />
      <FloorplanViewer
        ref={viewer}
        plan={plan}
        markers={markers}
        theme="paper"
        markersDraggable
        onPlanClick={({ x, y, room }) => console.log(x, y, room?.name)}
        onMarkerMove={({ marker, x, y }) => setMarkers((ms) => ms.map((m) => (m.id === marker.id ? { ...m, x, y } : m)))}
        renderMarker={(marker, { selected }) => <MyPin marker={marker} selected={selected} />}
        style={{ height: 600 }}
      />
      <button onClick={() => viewer.current?.focusMarker('ap-1')}>Show AP 1</button>
    </>
  )
}
// 3D: a separate entry, so three.js only loads where it's used
import { FloorplanViewer3D } from '@jbaysolutions/floorplan-react/3d'
  • Props are the elements' properties (plan, markers, floor, theme, showFurniture…), plus className, style, id, data-* and aria-*. A prop is passed to the component only when its value changes, so what the component changes itself (the plan being edited, the floor shown) stays as it is until you pass something new.
  • Callbacks get plain values: onChange(plan), onFloorChange(floor), onPlanClick(e), onMarkerClick(marker, event), onMarkerMove(e), onRoomHover(room), onModeChange(mode)…
  • Methods are on the ref, which is the element: fit(), focusMarker(), setFloor(), undo(), snapshot()…
  • renderMarker draws markers with your own React components.
  • Packs register with registerPack (and registerPack3D from /3d); the data helpers (createEmptyPlan, normalizePlan, formatArea…) are exported too.
  • Server rendering: the components are marked 'use client'. They render an empty element on the server and start in the browser.

Documentation: the React guide, and the full documentation for every prop, callback and method. For Vue 3 apps, use @jbaysolutions/floorplan-vue.

Licence

Free for open-source projects and for companies with under €1M yearly revenue, including in production. Other companies buy one commercial licence per company, per major version. Add-on packs are included. See LICENSE.md for the terms.

© JBay Solutions.