portal-vue

A Portal Component for Vue 3, to render DOM outside of a component, anywhere in the document.
20,911,515 3,880
Install
npm install portal-vue
Latest Version:3.0.0
Vue:3
Older releases:2
License:MIT
Last Updated:Nov 25, 2023
Links: GitHub  ·  npm
Maintainer: linusborg

PortalVue

A Portal Component for Vue 3, to render DOM outside of a component, anywhere in the document.

PortalVue Logo

Buy Me a Coffee at ko-fi.com

For more detailed documentation and additional Information, please visit the docs.

Looking for the version for Vue 2.*? Docs for PortalVue 2.*, compatible with Vue 2, are here

Installation

npm i portal-vue

# or

yarn add portal-vue
import PortalVue from 'portal-vue'
Vue.use(PortalVue)

Usage

<portal to="destination">
  <p>This slot content will be rendered wherever the <portal-target> with name 'destination'
    is  located.</p>
</portal>

<portal-target name="destination">
  <!--
  This component can be located anywhere in your App.
  The slot content of the above portal component will be rendered here.
  -->
</portal-target>

Nuxt module

Add portal-vue/nuxt to modules section of nuxt.config.js

{
  modules: ['portal-vue/nuxt']
}

Version History

Version Released Vue License
3.0.0 ^3.0.4 MIT
2.1.7 ^2.5.18 MIT
2.1.6 ^2.5.18 MIT
2.1.5 ^2.5.18 MIT
2.1.4 ^2.5.18 MIT
Pre-releases (21)
Version Released Vue License
3.0.0-rc.3 ^3.0.4 MIT
3.0.0-rc.2 ^3.0.4 MIT
3.0.0-rc.1 ^3.0.4 MIT
3.0.0-beta.0 ^3.0.4 MIT
3.0.0-alpha.0 ^3.0.4 MIT