Builder Webcomponents Full API
Builder Webcomponents are a great way to display dynamic Builder content on any tech stack
You just need the below script tag and
<builder-component> custom element. And optionally set the targeting attributes for Builder to dynamically load content.
The name of the your page or component model to display
Your Builder public API key
Load a specific Builder entry by ID, e.g.
If on, the component will observer location pushState events and reload when the browser URL changes client side, e.g. if you target different content for this code at different URL paths
Full Builder options object as JSON to customize how content is requested
Fires when the builder content loads and passes you the data loaded. Good for transitioning content, or tracking analytics such as what Builder content and a/b tests were viewed to other analytics providers
Fires when builder content failed to load
If you need to run some logic before Builder webcomponents fetch and render, you can use declare a window variable called
builderWcLoadCallbacks like in the example below: