🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-srcdoc-iframe

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-srcdoc-iframe

String HTML parse into iframe and supported IE6.This is polyfill of srcDoc.

1.0.3
latest
npm
Version published
Weekly downloads
910
-27.2%
Maintainers
1
Weekly downloads
 
Created
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

react

FAQs

Package 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