Published pages ship with a bundle of custom elements. They are real web components, so they work in plain HTML with no framework, and they cooperate with the runtime attributes.
Video tutorials for this topic
The elements
| Element | What it is |
|---|---|
<wm-tabs> | Tabbed panels |
<wm-accordion> / <wm-accordion-item> | Collapsible sections |
<wm-dialog> | Modal dialog |
<wm-drawer> | Slide-in panel — what the cart uses |
<wm-slider> | Carousel |
<wm-grid> | Responsive grid layout |
<wm-mega-menu> | Multi-column dropdown navigation |
<wm-storefront-product-control> | Product quantity and variant control |
Build Studio also has a handler for <wm-navigation>, but it is not in the bundle published pages load, so on the live page it stays an inert, unstyled tag. Build navigation from plain links, with wm-mega-menu or a wm-drawer for a menu.
Opening and closing
A <wm-dialog> or <wm-drawer> needs two children: one with slot="trigger", which opens it when clicked, and one with slot="content". Without both it does not initialise.
Other buttons drive it by action:
<button data-action="ui.dialog" data-payload='{"id":"signup","action":"open"}'>
Sign up
</button>
<button data-action="cart.toggle">Cart</button>ui.dialog, ui.drawer and ui.modal take {"id": "<element id>", "action": "open" | "close" | "toggle"}; action defaults to toggle. The id is the element's id, without a #.
Get the id right. When no wm-dialog has that id, ui.dialog falls back to the storefront quick view and tries to open a product with that id. With "#signup" instead of "signup", that took the whole page down to the site's "page didn't load" screen in testing.
The open-dialog and close-dialog effects only set or remove the open attribute. A wm-dialog or wm-drawer reads open once, when it initialises, so the effect changes the attribute and nothing on screen: open-dialog leaves the dialog hidden, close-dialog leaves it showing. Open and close with the ui.dialog / ui.drawer action, the trigger slot, or the element's own open() / close() methods from your script.
They hold live content
Custom elements are ordinary containers, so bound values and actions work inside them:
<wm-drawer id="basket">
<button slot="trigger">Basket (<span data-bind="cart.count"></span>)</button>
<div slot="content">
<p><strong data-bind="cart.total" data-format="currency"></strong></p>
<button data-action="cart.open">Review and check out</button>
</div>
</wm-drawer>Keep repeated rows out of wm-dialog and wm-drawer. When a data-loop or data-source inside one renders rows, the runtime rebuilds the element around them. In testing, a data-loop="cart.items" inside a wm-drawer froze the page, and the same loop inside a wm-dialog stripped the dialog's content. Put the list on the page beside the element, or use the host's own cart drawer (cart.toggle) for cart lines.
When you do list cart lines on a page, repeat over cart.items with data-loop, not a data-source on cart.current — that returns one object, so it renders no rows:
<div data-loop="cart.items">
<div data-bind-each>
<span data-bind="name"></span>
<span data-bind="unitPrice" data-format="currency"></span>
<button data-action="cart.remove" data-payload='{"id":"{{cartItemId}}"}'>Remove</button>
</div>
</div>Cart lines carry name, unitPrice, quantity and cartItemId at the top level, not under data, and the list re-renders by itself when a line is removed. In a payload, this.id would read the button's own id attribute, not the line's.
In design mode
The elements bundle is loaded in preview and on the published page, but not while you are editing. That is deliberate — a tab component that actually switches tabs would hide the panels you are trying to edit, and a drawer would close itself. In the canvas you see the slot structure instead.
Preview the page to see them behave.
Containers the panel recognizes
When you configure runtime behavior visually, the property panel treats wm-tabs, wm-accordion, wm-slider, wm-grid and wm-mega-menu as containers — the same as div, section and ul — so you can attach a data source to them and repeat their children.
