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-chained-modals

v1.0.10

Published

You can create one popup or few chained modals using this plugin

Readme

React chained modals Tweet

React version

Allow you to add few chained modals or just single popup in your react app. Easy to use and customizing. Check the demo page

screencast-amodin github io-2018 12 09-21-00-37

Getting Started

Installation

Get the package from npm

npm i react-chained-modals

Usage

Import:

import ChainedModal from "react-chained-modals";
import "react-chained-modals/src/modal.css"
import "animate.css"

then place:

<ChainedModal
  animationNext="fadeInRight"
  animationPrev="fadeInLeft"
  visible={this.state.showModal}
  onRequestClose={this.toggleModal}
  closeOnBackground
  animationSpeed="faster"
  elements={[
   {
     component: Modal1,
     props: { title: "First modal" }
   },
   {
     component: Modal2,
     props: { title: "Second modal" }
   },
   {
     component: Modal3,
     props: { title: "Third modal" }
   }
 ]}
/>

Methods and options

| Name | Type | Description | Default| | ------------- |:-------------:| ----------| ------- | | animationNext | string | Transition animation on showNext method call. View full list here Animate.css. This method will call also on popup first view.| none | animationPrev | string | Transition animation on showPrev method call. View full list here Animate.css| none | visible | bool | Is modals visible. Options: true, false | false | onRequestClose | function | Method that should set visible to false | closeOnBackground | bool | Should popup close on click at background. Options: true, false | false | animationSpeed | string | Define it if you want to change the animation speed. Options: "slow", "slower", "fast", "faster" | none | | elements | array | Each item in the array should have the component that will show and optional parameter props which put all 'props' you want to use in this component | none

Methods and options for each modal

In each component, that you added in elements you can get next next properties and methods from props:

| Name | Type | Description | | ------------- |:-------------:| --------- | | closeChainedModal | function | The onRequestClose function will be called | totalModals | number | Number of modals, length of array | showNext | function | Show next modal function | showPrev | function | Show prev modal function | currentModal | number | Current modal, index in array

Example of Modal1 component:

const Modal1 = props => {
  return (
    <div>
      {props.title} {props.currentModal}
      <div>{props.totalModals}</div>
      <div>
        <span onClick={props.showPrev()}>Go prev </span>
        <span onClick={props.showNext()}>Go next</span>
      </div>
      <button onClick={() => props.closeChainedModal()}>close modal</button>
    </div>
  );
};

Customizing:

Just replace your styles with styles from the module

Built With