Socket
Socket
Sign inDemoInstall

react-srcdoc-iframe

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-srcdoc-iframe


Version published
Maintainers
1
Install size
5.77 kB
Created

Readme

Source

React-srcDoc-iframe

Build Status

This is the polyfill of iframe srcDoc for react and supported upto IE-6.

  • Simple and light weight(<4KB).
  • Used both for src and srcDoc.
  • Easy to use.

Installation

Install the dependencies.

$ npm i react-srcdoc-iframe

Example

import React from 'react';
import ReactSrcDocIframe from 'react-srcdoc-iframe';

const html = `
  <!DOCTYPE html>
  <html>
    <head>
      <title>Hello Page</title>
    </head>
    <body>
        <p>Hello this is string html</p>
    </body>
  </html>
`;

const App = () => {
  return <ReactSrcDocIframe srcDoc={html} width="500" height="500" />;
};

Props

PluginREADME
srcstring (url to render inside html)
srcDocstring (html string to render inside iframe)
idstring (unique id for iframe)
styleobject ( {{border:"10px"}} )
onLoadfuntion (after load iframe this will be called)
titlestring ("title for iframe")
frameBorderstring ("0")
heightstring ("200px")
widthstring ("100px")
referrerPolicystring
sandboxstring

License

MIT

Free Software, Hell Yeah!

Keywords

FAQs

Last updated on 19 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc