2.4.1 • Published 5 years ago

react-js-live v2.4.1

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

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
2.4.1

5 years ago

2.4.0

5 years ago

2.3.2

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago