An open API service indexing awesome lists of open source software.

https://github.com/ambar/react-livecode

Live Demo: https://ambar.li/react-livecode/
https://github.com/ambar/react-livecode

Last synced: 9 months ago
JSON representation

Live Demo: https://ambar.li/react-livecode/

Awesome Lists containing this project

README

          

# react-livecode

> Experimental

Live code evaluating:

- Evaluate every expressions your typed, no need to use `console.log`.
- Inspect result side by side.
- Support modules (using `import`).

![screenshot](./screenshot.png)

## Install

```
npm install react-livecode
```

## Usage

```js
import LiveCode from 'react-livecode'
import chunk from 'lodash/chunk'

render(

)
```

### `LiveCode` props

| Prop | Type | Default | Description |
| ----------- | --------- | -------------- | ----------------------------------------------------------------------------------------- |
| `scope` | `Object` | `{}` | Scope variables |
| `code` | `string` | `''` | Code to evaluate |
| `split` | `string` | `'horizontal'` | How to split editor and console, can be `horizontal` or `vertical` |
| `autoFocus` | `boolean` | `false` | Auto focus editor |
| `modules` | `boolean` | `true` | Enable using of [modules](https://developers.google.com/web/fundamentals/primers/modules) |

### Code highlighting

Import Prism styles to your page:

```js
import 'prismjs/themes/prism.css'
```

Or, load from external CDN:

```html

```