Actions
Portal
Description
The Portal action can be used to move an element to another location in the DOM, this can be useful for example when you want to render overlays on your body.
Usage
<script lang="ts">
import { portal, type PortalParameters } from 'action-archive';
const portalParameters: PortalParameters = {
target: document.body
};
</script>
<div use:portal={portalParameters} />
Example
Portal me!
#container1
#container2
API
Parameters
Name | Type | Default | Description |
---|---|---|---|
target | HTMLElement | string | document.body | Element or query selected element the element will be appended to. |
disabled | boolean | false | Disables the action. |