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

react-native-popup-manager

v0.2.3

Published

test

Readme

react-native-popup-manager

Popup manager for react native apps

Installation

If you use npm:
npm install react-native-popup-manager
Or if you use Yarn:
yarn add react-native-popup-manager

Usage

1. Wrap your app with the PopupProvider component.
import React from 'react';
import { PopupProvider } from 'react-native-popup-manager';

export default function App() {
  return ( 
	<PopupProvider> ... </PopupProvider>
  )
}
The PopupProvider component can get all the react native Modal props.
2. Now you can use the PopupManager from everywhere you want to show popup or popups in parallel.
import React from 'react';
import { PopupProvider, PopupManager, closeAction, clearPopupsAction } from 'react-native-popup-manager';

function showThreePopupsInParallel() {
  const popupOne: DefaultTemplateProps = {
	title: 'Popup 1',
	content: "Popup content",
	confirmButtonText: "confirm",
	cancelButtonText: "cancel",
	onConfirm: closeAction(() => { console.log("Confirm!!") }),
	onCancel: clearPopupsAction(() => console.log("Cancel!!"))
  }
  PopupManager.add(popupOne)
		
  const popupTwo: DefaultTemplateProps = {
	title: 'Popup 2',
	confirmButtonText: "confirm",
	cancelButtonText: "cancel",
	onConfirm: closeAction(() => { console.log("Confirm!!") }),
	onCancel: clearPopupsAction(() => console.log("Cancel!!"))
  }
  PopupManager.add(popupTwo)
		
  const popupThree: DefaultTemplateProps = {
	title: 'Popup 3',
	content: "Popup content"
  }
  PopupManager.add(popupThree)
		
  PopupManager.next() // This function will start show all the popups in parallel.
}

Add the popups object config to the popup manager, after that you can call the next function to start show the popups in parallel.

Also here you can send any react native Modal props for extra configuration of the specific popup.
Popup manager has a default template for all the popups(or with type default) that will expect to get this properties.
Default Template Props:

| Name | Type | Default | Description | | -------------------------------- | -------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | title | string | - | Popup title | content | string | - | Popup content | confirmButtonText | string | - | Popup confirm button text | cancelButtonText | string | - | Popup cancel button text | onConfirm | string | - | Popup confirm button callback | onCancel | string | - | Popup cancel button callback

Or we can build our own custom template:

For example:

import React from 'react';
import { View, Text, Button } from 'react-native';
import { PopupManager } from 'react-native-popup-manager';
import type { DefaultTemplateProps, PopupOptions } from 'react-native-popup-manager/@types';

interface WarningTemplateProps extends PopupOptions {
  content: string
}

const WarningTemplate: React.FC<WarningTemplateProps> = ({ content }) => {
  return <View style={{ height: 300, width: 300, justifyContent: 'center', alignItems: 'center', backgroundColor: 'white' }}>
    <Text style={{ fontWeight: 'bold' }}>Warning Popup</Text>
    <Text style={{ color: 'red', padding: 7 }}>{content}</Text>
    <Button onPress={PopupManager.next} title='OK, close this popup!' />
  </View>
}
Notice that the component props will get from the popup config opject that we send to the PopupManager.
We can use some helpers for generate our custom template.
closeAction:
import { closeAction } from 'react-native-popup-manager';
<Button onPress={closeAction(/*function will call before close popup*/)} title='close button' />
clearPopupsAction:
import { clearPopupsAction } from 'react-native-popup-manager';
<Button onPress={clearPopupsAction(/*function will call before close popup*/)} title='clear popups button' />
Now we have to send this template to the PopupProvider like that:
const customTemplates = {
  warning: WarningTemplate
}
  
return (
  <PopupProvider templates={customTemplates}> ... </PopupProvider>
)

We provide the popup manager our WarningTemplate component, that will show when we add a popup config to the PopupManager with type warning.

Finally we can use our custom template with the Popupmanager:
const warningPopup: WarningTemplateProps = {
  type: 'warning',
  content: "This is warning popup with content!"
}

PopupManager.add(warningPopup)

PopupManager functions:

| Function | Description | | -------------------------------- | --------------------------------------------------------------------------------- | | add | Add new popup config. | addFirst | Add new popup config and force the popup to be the next. | clear | Delete all the popups. | next | Close the current popup(if exist) and show the next one(if exist).

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library