KScript docs
EN

Components

Portals

A portal moves its template contents to a matching HTML container outside the live component. This lets overlays escape local clipping while their events and bindings still belong to the source component. The portal disappears when its template disappears or when the page changes. Include a form in the template with its fields, or associate the fields with an external form using HTML's form attribute.

HTML page
<div id="overlay-root"></div>
<live id="editor">
  <state name="open" value="true" />
  <if test="$open">
    <template live-portal="#overlay-root">
      <aside><button on-click="$open = false">Close</button></aside>
    </template>
  </if>
</live>