Sitelet https://github.com/nasso/svelte-teleport
Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

26 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages