This component provides an isolated environment for arbitrary HTML via iframes.
import { SandBox } from '@wordpress/components';
const MySandBox = () => (
<SandBox html="<p>Content</p>" title="SandBox" type="embed" />
);
The HTML to render in the body of the iframe document.
- Required: No
- Default: ""
The onFocus
callback for the iframe.
- Required: No
An array of script URLs to inject as <script>
tags into the bottom of the <body>
of the iframe document.
- Required: No
- Default: []
An array of CSS strings to inject into the <head>
of the iframe document.
- Required: No
- Default: []
The <title>
of the iframe document.
- Required: No
- Default: ""
The CSS class name to apply to the <html>
and <body>
elements of the iframe.
- Required: No
- Default: ""
The tabindex
the iframe should receive.
- Required: No