Portal
A component for renders content outside the main DOM hierarchy, useful for modals, tooltips, or overlays that need to escape parent styling or positioning constraints.
View source
Portal content
<script lang="ts">
import { Portal } from 'svxui';
</script>
<Portal target="#target-id">
Portal content
</Portal>
<div id="target-id"></div>
API Reference
Property | Type | Default | Description |
---|---|---|---|
children Snippet | Snippet<[void]> | Portal content to render | |
disabled | boolean | false | Disable portal |
target | string | HTMLElement | "body" | Target identifier or any HTMLElement |
Examples
Toggle portal
Portal source
Portal content
Portal destination