Skip to content

lilonga/live-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@lilonga/live-editor

Modular live-coding environment for React

NPM

Demo

[Demo]

@lilonga/live-editor demo on Repl.it

Install

npm install --save @lilonga/live-editor

Usage

import React, { Component } from "react";

import LiveEditor from "@lilonga/live-editor";
import OutputIframe from "@lilonga/output-iframe";

let iframeCode = `
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <title>A title</title>
</head>
<body>
  Hello world
</body>
</html>

`;

class App extends Component {
  constructor(){
    super()
    this.state = {
      input:iframeCode,
    }
  }
  render() {
    return (

      <div>
        <LiveEditor
          input={this.state.input}
          onInputChange={(input) => {
            this.setState({input})
          }}
          editorProps={{
            mode:'html'
          }}
          width={"100%"}
          height={"400px"}
          outputComponent={OutputIframe}
          outputProps={{

          }}
        />

      </div>
    );
  }
}

export default App;

License

MIT © Luka Kakia

About

Modular live-coding environment for React

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published