Ready

👨‍💼 When iframes load in AI chat, the host application doesn't know when they're ready to receive data or handle interactions. Without this handshake, users see broken interfaces or endless loading states.
// Notify the host that the iframe is ready
useEffect(() => {
	window.parent.postMessage({ type: 'ui-lifecycle-iframe-ready' }, '*')
}, [])
The ui-lifecycle-iframe-ready message tells the host that the iframe has loaded and is ready for communication. This enables the host to send initial data and makes interactions work properly.
IframeHostUserIframeHostUserRequests journal viewerCreates iframe elementLoads iframe contentComponent mountspostMessage('ui-lifecycle-iframe-ready')Marks iframe as readySends initial dataRenders with dataShows interactive interface
Always send the ready message as soon as the component mounts. Delaying this message means the host application will wait indefinitely.
📜 For more details on the MCP UI lifecycle protocol, see the MCP UI Embeddable UI documentation.
Now, implement the lifecycle communication to make your iframe ready for interaction!

Please set the playground first

Loading "Ready"
Loading "Ready"