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

@jeevandev/flow-canvas

v0.1.6

Published

A performant page-based design canvas library for React

Downloads

23

Readme

@jeevandev/flow-canvas

A powerful, production-ready, page-based canvas editor library for React. Build interactive design experiences like Figma/Canva with drag, resize, rotate, grouping, and multi-page support.

NPM Version License: MIT TypeScript

✨ Features

  • 🎨 Multi-Page Canvas - Create and manage multiple pages with smooth scrolling

  • 🖱️ Interactive Elements - Drag, resize, rotate with smooth interactions

  • 📏 Smart Snapping & Margins - Visual snap guides and customizable page margins

  • 🔄 Cross-Page Dragging - Move elements between pages with ghost preview

  • 👥 Grouping - Group/ungroup elements with professional editing mode

  • 🎯 Multi-Selection - Select and manipulate multiple elements

  • ⌨️ Keyboard Shortcuts - Full keyboard support (Undo/Redo, Copy/Paste, etc.)

  • 🔍 Zoom & Pan - Smooth zoom controls

  • High Performance - Viewport culling and virtualization for large datasets

  • Accessible - ARIA labels and keyboard navigation support

  • 📦 TypeScript - Full type safety and IntelliSense support

  • 🎨 Customizable - Extensive configuration options and theming

📦 Installation

npm install @jeevandev/flow-canvas

🚀 Quick Start

import { Editor, Canvas } from "@jeevandev/flow-canvas";
import "@jeevandev/flow-canvas/style.css";

function App() {
  const initialPages = [
    {
      id: "page-1",
      width: 1920,
      height: 1080,
      name: "Page 1",
      backgroundColor: "#ffffff",
    },
  ];

  return (
    <Editor
      initialPages={initialPages}
      config={{
        snapping: true,
        snapGuide: true,
        showGrid: true,
        gridSize: 20,
      }}
    >
      <Canvas />
    </Editor>
  );
}

📖 Documentation

Complete documentation is available in the docs/ directory:

See docs/README.md for the complete documentation index.

🎯 Core Concepts

Pages

Pages are the containers for your design elements. Each page has dimensions, background color, and can contain multiple elements.

const pages = [
  {
    id: "page-1",
    width: 1920,
    height: 1080,
    backgroundColor: "#ffffff",
    name: "Home Page",
  },
];

Nodes (Elements)

Nodes are the interactive elements on your canvas. They can be dragged, resized, rotated, and grouped.

const nodes = [
  {
    id: "node-1",
    x: 100,
    y: 100,
    width: 200,
    height: 100,
    pageId: "page-1",
    draggable: true,
    resizable: true,
    rotatable: true,
    data: { label: "My Element" },
  },
];

Configuration

Customize the editor behavior with the config prop:

<Editor
  config={{
    snapping: true,        // Enable snapping
    snapGuide: true,        // Show snap guides
    showGrid: true,         // Show grid
    gridSize: 20,          // Grid size in pixels
    pageWidth: 1920,       // Default page width
    pageHeight: 1080,      // Default page height
    minZoom: 0.1,          // Minimum zoom level
    maxZoom: 3,            // Maximum zoom level
    rotation: true,         // Enable rotation
    viewportCulling: true, // Enable viewport culling
  }}
>

🔧 Basic Usage

Adding Elements

import { useEditor } from "@jeevandev/flow-canvas";

function Toolbar() {
  const addNode = useEditor((state) => state.addNode);

  const handleAddElement = () => {
    addNode({
      id: `element-${Date.now()}`,
      x: 100,
      y: 100,
      width: 200,
      height: 100,
      pageId: "page-1",
      draggable: true,
      resizable: true,
      rotatable: true,
    });
  };

  return <button onClick={handleAddElement}>Add Element</button>;
}

Custom Node Types

import { NodeComponentProps } from "@jeevandev/flow-canvas";

const CustomNode = ({ data, style, className }: NodeComponentProps) => (
  <div style={style} className={className}>
    <h2>{data?.title}</h2>
    <p>{data?.description}</p>
  </div>
);

<Canvas nodeTypes={{ custom: CustomNode }} />;

Selection

const selectedIds = useEditor((state) => state.selectedIds);
const selectNode = useEditor((state) => state.selectNode);
const deselectAll = useEditor((state) => state.deselectAll);

// Select a node
selectNode("node-1");

// Deselect all
deselectAll();

🎨 Styling

The library includes default styles that you can import:

import "@jeevandev/flow-canvas/style.css";

You can customize styles using CSS variables or by overriding the default classes. See Configuration for details.

⚡ Performance

The library is optimized for performance:

  • Viewport Culling - Only renders visible elements (enabled by default)
  • Virtualization - Advanced virtualization for 100+ elements
  • Memoization - React.memo and useMemo for optimal re-renders
  • Bundle Size - Optimized bundle (121KB UMD, 38KB gzipped)

📊 Bundle Size

| Format | Size | Gzipped | | --------- | ------ | ------- | | ES Module | 165 KB | 43 KB | | UMD | 121 KB | 38 KB | | CSS | 13 KB | 2.8 KB |

🧪 Development

# Install dependencies
npm install

# Start dev server
npm run dev

# Build library
npm run build

# Run tests
npm test

# Type check
npx tsc --noEmit

📝 Changelog

See CHANGELOG.md for version history and release notes.

🤝 Contributing

Contributions are welcome! Please read our contributing guidelines and code of conduct.

📄 License

MIT © Jeevan Jose

🙏 Acknowledgments

Built with:


Ready for production use ✅ | TypeScript ✅ | Accessible ✅ | Well-tested