All Projects → ctxhou → React Poppop

ctxhou / React Poppop

A mobile support and multi-directional modal for ReactJS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Poppop

LSDialogViewController
Custom Dialog for iOS written in Swift
Stars: ✭ 74 (-5.13%)
Mutual labels:  modal, dialog, popup
Django Admin Interface
django's default admin interface made customizable. popup windows replaced by modals. :mage: ⚡️
Stars: ✭ 717 (+819.23%)
Mutual labels:  modal, popup, responsive
vue-modal
Reusable Modal component, supports own custom HTML, text and classes.
Stars: ✭ 29 (-62.82%)
Mutual labels:  modal, dialog, popup
Pmalertcontroller
PMAlertController is a great and customizable alert that can substitute UIAlertController
Stars: ✭ 2,397 (+2973.08%)
Mutual labels:  dialog, modal, popup
plain-modal
The simple library for customizable modal window.
Stars: ✭ 21 (-73.08%)
Mutual labels:  modal, dialog, popup
React Native Simple Dialogs
⚛ Cross-platform React Native dialogs based on the Modal component
Stars: ✭ 218 (+179.49%)
Mutual labels:  dialog, modal, popup
Sweetalert
A beautiful replacement for JavaScript's "alert"
Stars: ✭ 21,871 (+27939.74%)
Mutual labels:  dialog, modal, popup
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (+28.21%)
Mutual labels:  dialog, modal, popup
react-redux-modal-flex
[DEPRECATED] Make easy a modal/popup with Redux
Stars: ✭ 14 (-82.05%)
Mutual labels:  modal, dialog, popup
eins-modal
Simple to use modal / alert / dialog / popup. Created with pure JS. No javascript knowledge required! Works on every browser and device! IE9
Stars: ✭ 30 (-61.54%)
Mutual labels:  modal, dialog, popup
Popmodal
jquery plugin for showing tooltips, titles, modal dialogs and etc
Stars: ✭ 149 (+91.03%)
Mutual labels:  dialog, modal, popup
Popupdialog
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
Stars: ✭ 3,709 (+4655.13%)
Mutual labels:  dialog, modal, popup
Svelte Simple Modal
A simple, small, and content-agnostic modal for Svelte v3
Stars: ✭ 130 (+66.67%)
Mutual labels:  dialog, modal, popup
Nativepopup
Clone of Apple iOS App's feedback popup, and easily customizable.
Stars: ✭ 247 (+216.67%)
Mutual labels:  dialog, modal, popup
React Native Push Notification Popup
A <NotificationPopup/> component for presenting your own push notification in react-native app
Stars: ✭ 111 (+42.31%)
Mutual labels:  dialog, modal, popup
react-spring-bottom-sheet
Accessible ♿️, Delightful ✨, & Fast 🚀
Stars: ✭ 604 (+674.36%)
Mutual labels:  modal, dialog, popup
Jbox
jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more.
Stars: ✭ 1,251 (+1503.85%)
Mutual labels:  dialog, modal, popup
vue-modal
A customizable, stackable, and lightweight modal component for Vue.
Stars: ✭ 96 (+23.08%)
Mutual labels:  modal, dialog, popup
Vue Ydui
A mobile components Library with Vue2.js. 一只基于Vue2.x的移动端组件库。
Stars: ✭ 2,798 (+3487.18%)
Mutual labels:  mobile, dialog, popup
React Native Alert Pro
The Pro Version of React Native Alert (Android & iOS)
Stars: ✭ 69 (-11.54%)
Mutual labels:  dialog, modal, popup

React Poppop

A responsive, mobile support, multi directions and easy to use modal for ReactJS.

Compatible with React 15 and 16.

version travis Build status david codecov Maintainability download

Demo

img

Features

  • Mobile support — Responsive and support tap action.
  • Multi directions — support 9 positions. ↑ ↗ ︎→ ↘ ︎↓ ↙ ︎← ↖ ︎⥁
  • Easily customize style
  • React v16 portal — Using react v16 official portal API. Also backward compatible with v15

Table of Contents

Installation

Install it with npm.

npm install react-poppop --save

Then, import the module by module bundler like webpack, browserify

// es6
import PopPop from 'react-poppop';

// not using es6
var PopPop = require('react-poppop');

UMD build is also available. If you do this, you'll need to include the dependencies:

For example:

<script src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script>
<script src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/[email protected]/prop-types.min.js"></script>
<script src="https://unpkg.com/react-poppop/dist/react-poppop.min.js"></script>

You can reference standalone.html example.

Usage

Minimum Config

The miminum usage of PopPop is set open as true.

<PopPop open={true}>
  <h1>Title</h1>
  <p>Content</p>
</PopPop>

Multi directions - 9 positions

The default position of react-poppop is Top Center.

There are 9 positions provided by react-poppop.

'topLeft', 'topCenter', 'topRight', 'centerLeft', 'centerCenter', 'centerRight', 'bottomLeft', 'bottomCenter', 'bottomRight'

Select a position you want and pass it to position props.

Example

<PopPop open={true}
        position="topRight">
  <h1>Title</h1>
  <p>Content</p>
</PopPop>

Controllable

You can set onClose callback, close by click close button, esc button and overlay.

import React, {Component} from 'react';
import PopPop from 'react-poppop';

export default class Example extends Component {
  constructor(props) {
    super(props);
    this.state = {
      show: false
    }
  }

  toggleShow = show => {
    this.setState({show});
  }

  render() {
    const {show} = this.state;
    return (
      <div>
        <button className="btn btn-default" onClick={() => this.toggleShow(true)}>Show Modal</button>
        <PopPop position="centerCenter"
                open={show}
                closeBtn={true}
                closeOnEsc={true}
                onClose={() => this.toggleShow(false)}
                closeOnOverlay={true}>
          <h1>title</h1>
          <p>
            content
          </p>
        </PopPop>
      </div>
    )
  }
}

Props

* means required

Props Type Default Description
open * bool Open the modal or not
closeBtn bool false Whether to show close button
closeOnOverlay bool true Whether to close modal on click overlay area
closeOnEsc bool false Whether to close modal when click `esc`
onClose function close modal callback
position topLeft
topCenter
topRight
centerLeft
centerCenter
centerRight
bottomLeft
bottomCenter
bottomRight
topCenter Modal position
overlayStyle object reference: link customize overlay style
contentStyle object reference: link customize content style

License

MIT @ctxhou

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].