Portal
Moves an element to a different part of the DOM (e.g., document.body). Useful for modals, tooltips, or overlays.
source
portal content
target
Usage
<script>
import { portal } from 'svxui';
</script>
<div
{@attach portal({
// Enable/disable portal
enabled: true,
// Define portal target
target: '#target'
})}
>
content
</div>
<!-- elsewhere in the application -->
<div id="target">target</div>API Reference
PortalOptions
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable/disable portal |
target | union | 'body' | Portal target |