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

@qnit/react-modal-manager

v1.3.1

Published

A simple tool for organized modals in your application.

Readme

@qnit/react-modal-manager

A simple tool for organized modals in your application.

Usage:

  1. Import the proivider component
import { ModalProvider } from 'react-modal-provider';
  1. Wrap your App in ModalProvider:
<ModalProvider>
  <App />
</ModalProvider>
  1. Import useModalQueue hook in the component where you whant your modal to be:
import { useModalQueue } from '@qnit/react-modal-manager';

const { modals, queueModal } = useModalQueue()
  1. Use queueModal function to add a modal to a tree with either string for default modal, or react node:
const showModal = () => {
  queueModal({content: 'My Modal!'})
}

const showModal2 = () => {
  const newModal = (
    <div>
      <h1>New Modal</h1>
      <p>This is a new modal window.</p>
    </div>
  )
  queueModal({ content: newModal, onClose: () => { console.log('Modal closed'); } });
}
  1. You can pass an onClose callback to the queueModal function, callback will execute before closing the modal. Async callbacks are supported and closing resolves after the callback.

Debugging with provider options

  1. Universal Logs. false by default. Pass as true to see logs, warning and errors from undergoing processes and more info about your modals.
<ModalProvider options={{ universalLogs: true }}>
  1. RethrowOnCloseError. true by default. Pass as false to execute closing logic despite the errors in your onClose callback.
<ModalProvider options={{ universalLogs: true, rethrowOnCloseError: false }}>

Customization

Excluding custom modals, you can customise styles of the modal differently:

Options object

You can pass options object right into queueModal function like so:

  queueModal({content: 'hihihi', onClose: () => { console.log('Modal closed') }, options: { position: 'top-right' } });

Inline styles

Just pass the styles into ModalProvider component, and they will be applied to the default modal component:

<ModalProvider styles={{ background: 'red'}}>
  <App />
</ModalProvider>

Custom default component

You can also create a component for provider to use by default using ModalOverride prop like so:

<ModalProvider ModalOverride={DefaultOverrideExample}>
  <App />
</ModalProvider>

Inside your component, import ModalGeneric type

import type { ModalGeneric } from "react-modal-provider";

And set props for your component as:

const DefaultOverrideExample: React.FC<PropsWithChildren<{} & ModalGeneric>> = ({ children, onClose, styles })

children prop will be used as a slot for content you pass to the modal and onClose will execute closing and additional callback, if you added them from queueModal

Every modal will automatically open on top of the old one and close when you press on the background.

License

MIT © 2025 Pavlo Zabuha