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

react-js-live

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-js-live

JS Playground

latest
npmnpm
Version
2.4.1
Version published
Weekly downloads
2
-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

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:

  • id

A string that uniquely identifies the frame on the page.

  • 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)`
};
  • mode

    default: js

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

    default: Night Owl

    Any PrismJS theme.

Contributing

  • Clone the repo
  • npm install
  • npm start

Keywords

react

FAQs

Package last updated on 03 Feb 2019

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