1.0.2 • Published 5 years ago

@toffysoft/react-simple-modal v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

react-simple-modal

Simple modal component for React.

NPM JavaScript Style Guide

Install

npm install --save react-simple-modal

Usage

import React, { Component } from "react";

import Modal, {
  DEFAULT,
  TOP,
  BOTTOM,
  LEFT,
  RIGHT,
  SCALE_DOWN,
  VERTICAL_FLIP,
  HORIZONTAL_FLIP,
  ROTATE,
  TINY,
  DARK,
  LIGHT
} from "@toffysoft/react-simple-modal";

class Example extends Component {
  render() {
    const { isActive } = this.state;
    return (
      <Modal
        backdropColor={LIGHT}
        animate={ROTATE}
        onBackdropClick={handleClose}
        onCloseButtonClick={handleClose}
        open={isActive}
      >
        ...
      </Modal>
    );
  }
}

Props

Modal

NameTypeDefaultDescription
onBackdropClickfuncnullCallback fired when the backdrop is clicked.
backdropColordark || light || custom-color(linear-gradient(-180deg, #ff1c68 0%, #9f0092 98%))darkBackdrop color.
backdropbooltrueShow or hide backdrop.
closeButtonbool || default || tinydefaultShow or hide close button and specified style of button.
onCloseButtonClickfuncnullCallback fired when the close button is clicked.
open*boolControl if the modal is open or not.
childrennodenullThe content of the modal.
widthnumber |or| stringnullModal width.
heightnumber |or| stringnullModal height.
animatedefault(scale) || top || bottom || left || right || scale-down || vertical(flip) || horizontal(flip) || rotatedefault(scale)Animation type.

License

MIT © toffysoft

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago