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

@opncanvas/react-editor

v0.1.0

Published

Full React editor UI components for design schemas with drag & drop

Readme

@opncanvas/react-editor

Full React editor UI components for design schemas with drag & drop support.

Installation

npm install @opncanvas/react-editor @opncanvas/schema @opncanvas/engine @opncanvas/react-renderer @opncanvas/exporter react react-dom

Quick Start

import { Editor } from '@opncanvas/react-editor'
import { emailCaptureTemplate } from '@opncanvas/templates'

function App() {
  return (
    <Editor
      initialSchema={emailCaptureTemplate}
      onSchemaChange={(newSchema) => {
        console.log('Schema changed:', newSchema)
        // Save to localStorage, database, etc.
      }}
      onAction={(node) => {
        console.log('Action triggered:', node)
      }}
    />
  )
}

Components

Editor

Main editor component with panels, canvas, and export functionality.

Props:

  • initialSchema - Initial schema to load
  • onSchemaChange? - Callback when schema changes
  • onAction? - Callback when an action is triggered
<Editor
  initialSchema={mySchema}
  onSchemaChange={(schema) => saveSchema(schema)}
  onAction={(node) => handleAction(node)}
/>

Canvas

Preview canvas with drag & drop support using dnd-kit.

Props:

  • schema - Current schema
  • setSchema - Schema updater function
  • selectedBlockId - Currently selected block ID
  • setSelectedBlockId - Function to set selected block
  • onAction? - Action handler
<Canvas
  schema={schema}
  setSchema={setSchema}
  selectedBlockId={selectedId}
  setSelectedBlockId={setSelectedId}
/>

Editor Panels

Individual editor panels for different node types:

  • ButtonEditorPanel - Edit button properties
  • TextEditorPanel - Edit text properties (header, subtext, legal)
  • InputEditorPanel - Edit input properties (email, phone)
  • BackgroundEditorPanel - Edit background/container properties

Editor Controls

Reusable form inputs:

  • TextInput - Text input field
  • NumberInput - Number input field
  • ColorInput - Color picker
  • SelectInput - Dropdown select
  • createPropertyHandler - Helper for property change handlers

Features

Drag & Drop

The editor includes built-in drag & drop support for reordering elements. Users can click and drag elements to reorder them in the canvas.

Property Editing

Click any element in the canvas to edit its properties in the side panel:

  • Text content
  • Colors (background, text, border)
  • Sizing (width, height, padding, margins)
  • Typography (font family, size, weight, alignment)
  • Borders and shadows

Export

Click the "Export" button to generate production-ready HTML/CSS/JS code.

Styling

The editor uses CSS classes that you can style:

.editor-container {
  display: flex;
  gap: 20px;
}

.editor-panel {
  width: 300px;
  padding: 20px;
  background: #f5f5f5;
}

.renderer-panel {
  flex: 1;
  padding: 20px;
}

.renderer-canvas {
  background: #fff;
  min-height: 500px;
  padding: 40px;
}

.form-container {
  margin: 0 auto;
}

.selected {
  outline: 2px solid #0066ff;
}

.export-controls {
  padding: 20px;
}

Advanced Usage

Custom Actions

import { Editor } from '@opncanvas/react-editor'
import { ActionRegistry } from '@opncanvas/plugin-api'

const registry = new ActionRegistry()

registry.register({
  id: 'custom_submit',
  handler: async (data) => {
    await fetch('/api/submit', {
      method: 'POST',
      body: JSON.stringify(data)
    })
  }
})

function App() {
  return (
    <Editor
      initialSchema={mySchema}
      onAction={(node) => {
        if (node.type === 'button') {
          registry.execute(node.action)
        }
      }}
    />
  )
}

Save/Load Schemas

import { useState, useEffect } from 'react'
import { Editor } from '@opncanvas/react-editor'

function App() {
  const [schema, setSchema] = useState(() => {
    const saved = localStorage.getItem('my-schema')
    return saved ? JSON.parse(saved) : defaultSchema
  })

  return (
    <Editor
      initialSchema={schema}
      onSchemaChange={(newSchema) => {
        setSchema(newSchema)
        localStorage.setItem('my-schema', JSON.stringify(newSchema))
      }}
    />
  )
}

With History (Undo/Redo)

import { Editor } from '@opncanvas/react-editor'
import { useHistory } from '@opncanvas/history'

function App() {
  const { schema, setSchema, undo, redo, canUndo, canRedo } = useHistory(initialSchema)

  return (
    <div>
      <div className="toolbar">
        <button onClick={undo} disabled={!canUndo}>Undo</button>
        <button onClick={redo} disabled={!canRedo}>Redo</button>
      </div>
      <Editor
        initialSchema={schema}
        onSchemaChange={(newSchema) => {
          setSchema(() => newSchema, 'Update schema')
        }}
      />
    </div>
  )
}

License

Apache 2.0