JSPM

  • Created
  • Published
  • Downloads 117158
  • Score
    100M100P100Q164773F
  • License MIT

React Popup Component

Package Exports

  • reactjs-popup

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (reactjs-popup) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Reactjs-popup

Build Status BCH compliance License: MIT

NPM

built with react Fragment : react 16 Tiny 3KB

A Simple React popup. You can use it as a tooltip, modal,subMenu and more ...

React Popup Component

Demo

Live Demo

Installing / Getting started

npm install reactjs-popup --save
or
yarn add reactjs-popup -S

Include the Component

<Popup
  triggerOn="click"
  position="top,left"
  closeOnDocumentClick={true}
  trigger={<button>Button nested</button>}
>
  <div>popup content Here</div>
</Popup>

You can also use it with function as children pattern

<Popup
  triggerOn="click"
  position="top,left"
  closeOnDocumentClick={true}
  trigger={<button>Button nested</button>}
>
  {(open, close) => (
    <div>
      content here
      <a className="close" onClick={close}>
        &times;
      </a>
    </div>
  )}
</Popup>

You can find more examples in the reactjs-popup home page

Contributing

Clone Repo

Fork and then clone the repo

git clone git@github.com:your-username/reactjs-popup.git

Start Developing

Install all npm scripts:

npm install
or
yarn install

we use storybook in this project.before starting, be sure to have some basic knowledge https://storybook.js.org/

Run storybook :

npm run storybook

Run Test in watch mode

npm run storybook

To make contributing simply you need to create a new story with documentation under src/stories directory ( you can copy/past any story to start with ).

In this story, you need to present the new features or the bug fix and don't forget to document your story by using storybook info addon.

Make Changes. If you want to contribute check out the help wanted issues for things that need fixing.

Before submitting a pull request run npm run test to run the unit-tests and npm run eslint to check for linting errors in your changes.

Licensing

The code in this project is licensed under MIT license.