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

PropertyTypeDefaultDescription
children Snippet
Snippet<[void]>
Portal content to render
disabled
boolean
falseDisable portal
target
string | HTMLElement
"body"Target identifier or any HTMLElement

Examples

Toggle portal

Portal source
Portal content
Portal destination
v0.0.13