How to use the HTML Embed component
The "HTML Embed" component can be found in Components > General, and you can place it on your canvas by dragging and dropping it or clicking it in the Components panel.
How to add custom code to an HTML Embed instance
The "Code" section has a text area for adding your custom code. After you paste your code here, it will be rendered on the canvas. You can add anything to your site including custom widgets, third-party services, API integrations, animations, and interactive content.
Run Script on Canvas
How to reuse your custom code across multiple web pages
You can reuse your custom code across your project by putting it inside a Slot instance.
Add an HTML Embed component to your canvas and set it up with custom code of your choice.
Add a “Slot” component to your canvas and place your HTML Embed instance inside it.
Now, you can copy and paste this slot instance anywhere on your Webstudio project.
Please note that any updates you make inside your slot will update all other instances of that slot.
For more on Slots in Webstudio, refer to this guide.