react-sandbox-frame
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

React Sandbox Frame

npm version License Dependency Status devDependency Status npm

this package create an customizable and declarative iframe

usage

import React, { Component } from 'react'
import Frame from 'react-sandbox-frame'
 
export class WebView extends Component {
 
  /**
   * connect frame and you component
   * @param {HTMLElement} document 
   */
  onLoad (document) {
    console.log(document) // output <p>hello world</p>
  }
 
  render () {
    return (
      <Frame onLoad={this.onLoad.bind(this)}>
        <p>hello world</p>
      </Frame>
    )
  }
 
}

Optional Props

The Frame component takes a couple of props that you can use to customize its behaviour:

  • children [?element]
  • onLoad [?function]
  • src [?string]
  • style [?object]
  • title [?string=page-wrapper]
  • stylesheets [?Array<String>=[]]
  • scripts [?Array<String>=[]]

Readme

Keywords

Package Sidebar

Install

npm i react-sandbox-frame

Weekly Downloads

1

Version

0.2.2

License

MIT

Unpacked Size

10.9 kB

Total Files

5

Last publish

Collaborators

  • brunocarvalhodearaujo