Puck AI closed beta
Read docs
API ReferenceOverridesiframe

iframe

Override the root of the iframe.

const overrides = {
  iframe: ({ children, document }) => {
    useEffect(() => {
      if (document) {
        document.body.setAttribute("style", "background: hotpink;");
      }
    }, [document]);
 
    return <>{children}</>;
  },
};

Props

PropExampleType
document{}Document
children<div />ReactNode

document

The document of the iframe window.

children

The default node for the iframe.