New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@dropsy-ui/code-editor

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dropsy-ui/code-editor

A React-based embeddable code editor with live HTML/CSS/JS preview

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

CodeEditor

A React-based embeddable code editor with live HTML/CSS/JS preview.

Features

  • Live HTML, CSS, and JavaScript editing
  • Real-time preview with console output
  • Embeddable as a standalone widget
  • JSON import/export of editor state

Installation

npm install @dropsy-ui/code-editor

This will generate dist/code-editor.umd.js.

Usage

Add the following to your HTML:

<div id="editor-container"></div>
<script src="node_modules/@dropsy-ui/code-editor/dist/code-editor.umd.js"></script>
<script>
  // Provide scripts and styles for the preview iframe
  const scripts = [
    // Example: "https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"
  ];
  const styles = [
    // Example: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
  ];

  // Initialize the embedded editor
  const editor = new CodeEditor('#editor-container', {
    scripts, // Array of JS URLs for the preview iframe
    styles   // Array of CSS URLs for the preview iframe
  });
</script>

3. Editor State Import/Export

  • Export: Click the Save button to download the current state as a JSON file.
  • Import: Click the Upload button and select a previously saved JSON file to restore the editor state.

For development and contributing, see CONTRIBUTING.md.

Keywords

code-editor

FAQs

Package last updated on 03 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts