Svuick

Packages Guides

@svuick/portal

npm (scoped)

Installation

npm i @svuick/portal

What is this?

This package provides a Portal component.

Usage

<script lang="ts">
	import Portal, { portal } from '@svuick/portal';
</script>

<!-- component -->

<Portal target="body">
    <div>
        this will be mounted on the body element
    </div>
</Portal>

<!-- action -->

<div id="portal"></div>

<div use:portal={"#portal"}>
    this will be mounted on the #portal div
</div>
Released under the MIT License.
Copyright © 2022-present David Plugge