@wordpress/components
Version:
UI components for WordPress.
52 lines (51 loc) • 1.24 kB
text/typescript
export type SandBoxProps = {
/**
* Whether to include `allow-same-origin` in the iframe's sandbox
* attribute. When true, nested iframes (such as third-party embeds)
* can access their own origin's cookies and storage.
*
* Only enable this for content that is NOT directly user-controlled,
* such as server-fetched oEmbed previews.
*
* @default false
*/
allowSameOrigin?: boolean;
/**
* The HTML to render in the body of the iframe document.
*
* @default ''
*/
html?: string;
/**
* The `<title>` of the iframe document.
*
* @default ''
*/
title?: string;
/**
* The CSS class name to apply to the `<html>` and `<body>` elements of the iframe.
*/
type?: string;
/**
* An array of CSS strings to inject into the `<head>` of the iframe document.
*
* @default []
*/
styles?: string[];
/**
* An array of script URLs to inject as `<script>` tags into the bottom of the `<body>` of the iframe document.
*
* @default []
*/
scripts?: string[];
/**
* The `onFocus` callback for the iframe.
*/
onFocus?: React.DOMAttributes< HTMLIFrameElement >[ 'onFocus' ];
/**
* The `tabindex` the iframe should receive.
*
* @default 0
*/
tabIndex?: HTMLElement[ 'tabIndex' ];
};