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-flex-modal

v0.2.2

Published

A simple react flex modal

Downloads

8

Readme

ReactJS Modal

Modal component for ReactJS

Run example

git clone https://github.com/Volosojui/react-flex-modal
cd react-flex-modal
npm install
npm start
open http://localhost:9000

Install

npm install react-flex-modal --save

Usage

import React from 'react';
import Modal from 'react-flex-modal';

class MyModal extends Component {
  render() {
    return (
      <div>
        <Modal
          isOpen={true}
        >
          Modal content
        </Modal>
      </div>
    );
  }
}

Props

children

Type: node

The contents of the modal window

isOpen

Type: bool

Default: false

If true, then the modal window is visible, otherwise is hidden.

position

Type: string

Default: fixed

It should be equal to position property specified in the styles.

modalClass

Type: string

Default: ``

Custom a css-class of the modal

modalDialogClass

Type: string

Default: ``

Custom a css-class of the dialog

transition

Type: bool

Default: false

Use it only if you want to add the opening and closing CSS animations. You should specify the required styles within certain classes. See in the CSS classes.

Enable/Disable timer for the opening and closing CSS transitions. If enabled, you should set transitionEnterTimeout and transitionLeaveTimeout.

transitionEnterTimeout

Type: number

Default: 300 ms

The duration of CSS transition when the modal window is opening. It should be equal to the sum of the greatest duration and the greatest delay specified in transition property of CSS rule .Modal--enter.Modal--enter-active. See in the CSS classes.

For example:

/*
  transition-duration = .3s = 300ms
  transition-delay = 0s = 0ms
  transitionLeaveTimeout = 300ms + 0s = 300ms
 */

.Modal--enter.Modal--enter-active {
  ...
  transition: transform .3s ease, opacity .3s ease;
}

transitionLeaveTimeout

Type: number

Default: 300 ms

The duration of CSS transition when the modal window is closing. It should be equal to the sum of the greatest duration and the greatest delay specified in transition property of CSS rule .Modal--leave.Modal--leave-active. See in the CSS classes.

For example:

/*
  transition-duration = .3s = 300ms
  transition-delay = .1s = 100ms
  transitionLeaveTimeout = 300ms + 100ms = 400ms
 */

.Modal--leave.Modal--leave-active {
  ...
  transition: transform .2s ease, opacity .3s ease .1s;
}

onClose

Type: func

Default: undefined

The callback function that will be called when the modal window is closed.

CSS

The package does not include CSS styles, so you can customize the appearance of modal as you wish.

Animation classes

.Modal--enter

Defines the beginning of the modal window opening.

.Modal--enter.Modal--enter-active

Defines the actual opening.

.Modal--leave

Defines the beginning of the modal window closing.

.Modal--leave.Modal--leave-active

Defines the actual closing.


.Modal--enter {
  opacity: 0;
}

.Modal--enter.Modal--enter-active {
  opacity: 1;
  transition: opacity .3s ease;
}

.Modal--leave {
  opacity: 1;
}

.Modal--leave.Modal--leave-active {
  opacity: 0;
  transition: opacity .3s ease;
}

License