1.1.2 • Published 4 years ago

react-live-playground v1.1.2

Weekly downloads
14
License
MIT
Repository
github
Last release
4 years ago

React Live Playground

NPM

Playground wrapper around React Live!

Install

npm install --save react-live-playground
# or
yarn add react-live-playground

Example

example

Live example on my blog post.

Usage

import React from "react";
import ReactLivePlayground from "react-live-playground";

const Example = () => (
  <div style={{ maxWidth: "600px" }}>
    <ReactLivePlayground code=`<button>Example Button</button>` />
  </div>
);

Props

code: String

See React Live for the kind of React code you can use here. Pure JSX works because react-live pre-renders.

theme: Object

A prism-react-renderer theme object. See more in the README for prism-react-renderer.

scope: Object

To use global packages other than React (included by default), you have to scope them into react-live. More info in the react-live README.

Other LiveProvider Props

noInline, transformCode, language, disabled -> These can be found in the <LiveProvider /> README section

editorClass: String

CSS class name you can apply to style the Live Editor

errorClass: String

CSS class name you can apply to style the Live Error

previewClass: String

CSS class name you can apply to style the Live Preview

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago