npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@amj7/nativescript-vue-portal

v1.1.3

Published

Teleport Component adapted to work in NativeScript Vue3

Readme

PortalVue for NativeScript Vue 3

A Portal Component for NativeScript Vue 3, to render elements outside of a component, anywhere in your app.

Basic StackBlitz Example

Getting Started

  1. Install the package:

    npm i @amj7/nativescript-vue-portal
  2. Register the plugin in your main.ts (or equivalent):

    import { createApp } from 'vue'
    import Home from './components/Home.vue'
    import PortalVue from '@amj7/nativescript-vue-portal'
    
    const app = createApp(Home)
    PortalVue(app)
    app.start()

    This registers the necessary components and registers and App-level Provide for managing portal connections throughout your application.

  3. Use the Portal and PortalTarget components in your App:

    <template>
      <Portal to="myDestination">
        <label text="Hello from the Portal!" />
      </Portal>
      <PortalTarget name="myDestination" />
    </template>

Special Considerations

RootLayout:

The RootLayout will break vue events if we teleport multiple items in-and-out of it. To fix this, the wrap-prop was added to render all items within a GridLayout.

<Frame>
  <Page actionBarHidden="true">
    <RootLayout>
      <GridLayout>
        <!-- content -->
      </GridLayout>

      <PortalTarget name="destination" wrap multiple/>
    </RootLayout>
  </Page>
</Frame>

To change the default wrap element, use the as-prop. (as="StackLayout")

Use without installing globally:

You can import the components directly. The first created instance of Portal or PortalTarget will try to register the required App-level Provide.

<script setup lang="ts">
import { PortalTarget } from '@amj7/nativescript-vue-portal'
</script>

<template>
  <PortalTarget name="destination" />
</template>

API

<Portal>

Props:

  • to (String): The name of the PortalTarget where the content should be rendered.
  • name (String | Symbol, default: Unique ID): A unique identifier for the portal. Defaults to a generated unique ID.
  • disabled (Boolean, optional): If true, the portal will be disabled and the content will not be rendered in the target, but will render in it's original position.
  • order (Number, optional): Specifies the rendering order of the portal content within the target, especially useful when using multiple. Lower numbers render first.
  • slotProps (Object, optional): Props that are passed to the slot content of the portal, when it's rendered in it's original position.

<PortalTarget>

Props:

  • name (String, required): The unique name that matches the to prop of a Portal.
  • wrap (Boolean, optional, default: false): If true, wraps the rendered content in a layout element (specified by the as prop). Required when teleporting multiple items to a RootLayout to avoid event issues.
  • as (String, optional, default: GridLayout): The NativeScript layout element to use as the wrapper when wrap is true.
  • multiple (Boolean, optional, default: false): If true, allows multiple Portal components to render content to this PortalTarget.
  • slotProps (Object, default: {}): Props that are passed to the slot content of the PortalTarget.

Emits:

  • change (returns { hasContent: boolean, sources: Name[] }): Fires after items have been teleported in or out.

Credits

PortalVue