Send data to a webframe
Pass component state to content running in a webframe.
Before you start
Add the component
import { createComponent, createIntegration } from '@gitbook/runtime';
const webframeData = createComponent({
componentId: 'webframe-data',
render: async (element) => (
<block>
<textinput
state="content"
label="Message"
placeholder="Enter a message"
/>
<webframe
source={{ url: '/iframe.html' }}
data={{
content: element.dynamicState('content')
}}
/>
</block>
)
});
export default createIntegration({
components: [webframeData]
});Receive the data
Add the block to your manifest
Test the block
Next steps
Last updated
Was this helpful?