Skip to content

A Svelte component to teleport elements across the DOM

License

Notifications You must be signed in to change notification settings

nasso/svelte-teleport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svelte-teleport

A Svelte component to teleport elements across the DOM.

Example usage

You can also try it out on the REPL.

<script>
  import { Portal } from 'svelte-teleport';

  let portal_a;
  let portal_b;
</script>

<h1>Example</h1>

<button on:click={() => portal_a.teleport_to(portal_b)}>Teleport!</button>

<h2>Portal A</h2>

<Portal bind:this={portal_a}>
  <textarea>Hello world!</textarea>
</Portal>

<h2>Portal B</h2>

<Portal bind:this={portal_b}></Portal>

About

A Svelte component to teleport elements across the DOM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published