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-popapka

v1.0.7

Published

Simple react popup/modal function

Readme

react-popapka

Simple react popup function

NPM JavaScript Style Guide

Install

npm install --save react-popapka

Usage

import React, { Component } from 'react'

import { PopapkaContainer, popapka, closePopapka } from 'react-popapka';
import 'react-popapka/dist/index.css';

class Example extends Component {

  popapka = null

  open = () => {
    this.popapka = popapka({
      title: "this is my modal!!",
      content: (<div>this is content of my modal</div>),
      positiveButton: () => { closePopapka(this.popapka) },
      animation: 'bub'
    })
  }

  render() {
    return (
      <div>
        <PopapkaContainer />
        <button onClick={ this.open }>Open Popapka</button>
      </div>
    )
  }
}

Explain

Place the <PopapkaContainer /> component once into your application tree. It will be used as a wrapper for all modals. Don't forget to import the default styles from react-popapka/dist/index.css

Your component with <PopapkaContainer /> will be like this:

import React, { Component } from 'react'

import { PopapkaContainer } from 'react-popapka';
import 'react-popapka/src/popapka.scss'

class Example extends Component {
  render() {
    return (
      <div>
        <PopapkaContainer />
        // Other components
      </div>
    )
  }
}

Other functions can be called from other components. You don't need to worry about maintaining the global state. Popapka saves its state by itself.

Popapka

Simple usage: Will open a small modal window with just your text

popapka('alert')

Add more functionalities:

popapka({
  title: "this is my modal!!",
  content: (<div>this is content of my modal</div>),
  animation: 'bub'
})

closePopapka

Close popapka by index number of opened popapka. If you only have one popapka, you can simply call closePopapka(0). In complex cases, popapka function return its own index. closePopapka() without parameters will close latest opened popapka.

closeAllPopapka

closeAllPopapka() will close all opened popapka.

API

popapka(parameters, settings);

parameters object:

key | type | default | Description ----| ---- | ------- | ----------- title | String | | Title of popapka. On top of modal and bold highlighted content | String or jsx | | Main text positiveButton | function | | Add 'OK' button at bottom with your callback animation | one of the below animations | opacity | Animation for appear and disappear popapka close | inside, outside | | Position of close button. Will not be displayed if nothing is passed

settings object:

key | type | default | Description --- | ---- | ------- | ----------- className | String | popapka | Add custom class to popapka window

animations list:

type | Description ---- | ----------- opacity | Fade in with a change in opacity fromTop | A little drop from above bub | Appeared from the center with resizing and opacity

License

MIT © r1ddev