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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bit-about/native-portal

v1.0.0

Published

Powerfull extensible pipe architecture.

Readme

Install

npm i @bit-about/native-portal

Features

  • 100% Idiomatic React and 100% Typescript
  • Tiny & Efficient
  • Does not trigger unnecessary renderings
  • Just works

Usage

import { portal } from '@bit-about/native-portal'

// 1️⃣ Create a portal
const Portal = portal()

// 2️⃣ Wrap your app with Provider
const App = () => (
  <Portal.Provider>
    {/* ... */}
  </Portal.Provider>
)

⬜ Set injection target

const ComponentA = () => (
  <>
    <Portal.Target />
  </>
)

🌀 ...then inject content from elsewhere

const ComponentB = () => (
  <>
    <Portal.Injector>
      <Text>Hello!</Text>
    </Portal.Injector>
  </>
)

Thanks to this, when the ComponentB is rendered, the Hello! sentence will be moved to the ComponentA.

Many portals under one provider

import { portal } from '@bit-about/native-portal'

// Declare destinations during portal creation
const Portal = portal('toHeader', 'toMenu', 'toHeaven')

⬜ Set injection target using name prop

const Menu = () => (
  <>
    <Portal.Target name="toMenu" />
  </>
)

🌀 ...then inject content using name prop

const Screen = () => (
    <>
      <Portal.Injector name="toMenu">
        <Text>{'New menu option'}</Text>
      </Portal.Injector>
    </>
  )

Default content

To declare fallback content for portal that is not in use, you can just pass children prop to Target component.

<Portal.Target>
  <Text>{'I am only visible when no content has been injected.'}</Text>
</Portal.Target>

Don't you like the default names?

import { portal } from '@bit-about/native-portal'

const {
  Provider: MyAmazingProvider,
  Target: MyAmazingTarget,
  Injector: MyAmazingInjector,
} = portal()

// ... and then

const App = () => (
  <MyAmazingProvider>
    {/* ... */}
  </MyAmazingProvider>
)

Common Questions

► What happens if I use multiple Injectors for one portal at the same time?

It works like a stack. The Target will render the latest content. If the newest Injector is unmounted, the Target will render the previous one.

► What happens if I use multiple Targets for one portal at the same time?

Each Target will display the same content.

► Do I need to render Target before the Injectors?

Nope! When you render Target it will be automatically filled up by the injected content.

► Is this efficient? What about the re-renders?

Yes. Moreover, Providers and Injectors will be never unecessary re-rendered. Target rerender only when the latest injected content changes.

Partners

Credits

License

MIT © Maciej Olejnik 🇵🇱

Support me

If you use my library and you like it... it would be nice if you put the name BitAboutNativePortal in the work experience section of your resume. Thanks 🙇🏻!