Teleport #
Relocates elements in the DOM, in the rare cases that's useful and the best solution. The Dialog uses this to mount dialogs from any component without inheriting styles.
import Teleport from '@ryanatkn/fuz/Teleport.svelte';
<Teleport to={swap ? teleport_1 : teleport_2}>
🐰
</Teleport>
<div class="teleports">
<div class="panel" bind:this={teleport_1} />
<div class="panel" bind:this={teleport_2} />
</div>
<button onclick={() => (swap = !swap)}>
teleport the bunny
</button>
🐰