Skip to content

react-iframe-kit

Render into iframes, size them to their content, and talk to them with typed calls and events. One package, one connection per iframe.

Portal rendering

<Frame> and useIframe render React children into an iframe, and mount only after the iframe’s own document has loaded, not into the temporary about:blank before it.

Auto-resize

useIframeResize follows the content’s size, same-origin or cross-origin, with a guard against content that grows with the iframe forever.

Typed RPC and events

Describe each side once with Side<>, then call methods and emit events in both directions. Calls made before the handshake is complete are queued.

Safe by default

Origins are checked on both sides, and the child must list the parents it accepts. '*' needs an explicit unsafeAllowAnyOrigin.