Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.

agneym/react-js-live

Repository files navigation

Deprecated. Succeeded by Playground

JS Live

npm version Build Status Prettier

A React Component for live rendering and editing of HTML, CSS and JS.

screenshot

Usage

npm install react-js-live
import React from "react";
import JSLive from "react-js-live";
import "react-js-live/build/main.css";

function App() {
  return <JSLive id="test" snippets={snippets} mode="js" />;
}

Props:

  1. id

A string that uniquely identifies the frame on the page.

  1. snippets

Object containing keys: html, css and js. This is the initial code passed into the component.

const snippets = {
  html: `<p>HTML Content goes here</p>`,
  css: `.title { color: red; }`,
  js: `alert(js)`
};
  1. mode

    default: js

    1. html: Left tab defaults to HTML and Right defaults to Result
    2. js Left tab defaults to JS and Right tab to Console.
  2. theme

    default: Night Owl

    Any PrismJS theme.

Contributing

  1. Clone the repo
  2. npm install
  3. npm start

About

Live Frontend Editor Component for React

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages