@graph-paper/portal

0.0.0-alpha.15 • Public • Published

Portal

A Portal is a component that pulls its children outside of the current DOM tree, instead appending them to the end of the document. Useful for floating menus, modals, snackbars, and other elements and features that might need to "float" above the content.

This component solely handles placement at the end of the document.

usage

npm install @graph-paper/portal
<script>
import { portal } from '@graph-paper/portal';
</script>

<button on:click={toggle}>Toggle Portal</button>

{#if active}
  <Portal>This content comes after the content.</Portal>
{/if}

This content comes BEFORE the portal.

Readme

Keywords

none

Package Sidebar

Install

npm i @graph-paper/portal

Weekly Downloads

15

Version

0.0.0-alpha.15

License

MPL-2.0

Unpacked Size

18.5 kB

Total Files

7

Last publish

Collaborators

  • hamiltonulmer
  • openjck
  • wlach