Examples
Select in a dialog
A select opens its listbox inside a modal and the popup overlays the trigger instead of escaping to the page behind it, the seam a positioning regression once broke.
Preview
Data region
Choose where Acme Inc stores customer data.
<bs:bsui-dialog>
<bs:bsui-dialog-trigger trigger_label="Change region" trigger_variant="outline" />
<bs:bsui-dialog-backdrop />
<bs:bsui-dialog-popup>
<bs:bsui-dialog-header>
<bs:bsui-dialog-title content="Data region" />
<bs:bsui-dialog-description content="Choose where Acme Inc stores customer data." />
</bs:bsui-dialog-header>
<bs:bsui-dialog-content>
<bs:bsui-field>
<bs:bsui-field-label text="Region" />
<bs:bsui-select name="region" defaultValue="eu" placeholder="Pick a region">
<bs:bsui-select-trigger />
<bs:bsui-select-popup>
<bs:bsui-select-option value="eu" label="Europe" />
<bs:bsui-select-option value="us" label="United States" />
<bs:bsui-select-option value="ap" label="Asia Pacific" />
</bs:bsui-select-popup>
</bs:bsui-select>
<bs:bsui-field-description text="Moving regions re-encrypts every record overnight." />
</bs:bsui-field>
</bs:bsui-dialog-content>
<bs:bsui-dialog-footer>
<bs:bsui-dialog-close variant="outline" label="Cancel" />
<bs:bsui-dialog-close variant="default" label="Save" />
</bs:bsui-dialog-footer>
</bs:bsui-dialog-popup>
</bs:bsui-dialog>How it works
The dialog store portals its popup to the body and traps focus inside the aria-modal surface, while the select store anchors the listbox to its trigger with viewport coordinates that stay valid because the modal layer is untransformed. Directives keep Escape layered, closing the listbox on the first press and the dialog on the second.
Every behaviour on this page is the WordPress Interactivity API: each component registers its own store, seeds its state in a server rendered context, and wires events with directives in the markup above. There is no page specific JavaScript.