1.0.1 • Published 6 years ago

iframe-react v1.0.1

Weekly downloads
53
License
MIT
Repository
-
Last release
6 years ago

iframe-react

npm package

Simple iframe for React.

Install

npm i iframe-react -S

Simple Example

import React, { Component } from 'react';
import Frame from 'iframe-react';

class FrameExample extends Component {
  render() {
    return (
      <Frame
        title="iFrame example"
        style={{
          border: 'none',
          width: '100%',
          height: '100%',
        }}
      >
        <h1>iframe-react Demo</h1>
        <p>A simple example</p>
      </Frame>
    );
  }
}

Props

  • title: iFrame title.
  • head: Pass script, style, ... tags inside the head prop. You can wrap them inside a <Fragment> component or use an array.
  • frameRef: a callback to get a reference to the iframe element.
  • documentRef: a callback to get a reference to the iframe document element.

See a detailed example under the demo directory.

MIT Licensed