Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 761 Bytes

LiveEditor.md

File metadata and controls

31 lines (24 loc) · 761 Bytes

LiveEditor

The LiveEditor component is a wrapper around react-live, with basic UI and a ThemeProvider.

import React from 'react'
import { LiveEditor } from '@compositor/kit'
import { Button, theme } from '../src'

export default () => (
  <LiveEditor
    code='<Button>Hello</Button>'
    scope={{
      Button
    }}
    theme={theme}
  />
)
Prop Type Description
code string (required) JSX code for the example
scope object Object of components to include in scope
theme object Theme object passed to the ThemeProvider