Package Exports
- react-srcdoc-iframe
- react-srcdoc-iframe/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-srcdoc-iframe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React-srcDoc-iframe
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-iframeExample
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
| Plugin | README |
|---|---|
| src | string (url to render inside html) |
| srcDoc | string (html string to render inside iframe) |
| id | string (unique id for iframe) |
| style | object ( {{border:"10px"}} ) |
| onLoad | funtion (after load iframe this will be called) |
| title | string ("title for iframe") |
| frameBorder | string ("0") |
| height | string ("200px") |
| width | string ("100px") |
| referrerPolicy | string |
| sandbox | string |
License
MIT
Free Software, Hell Yeah!