react-modal-ib

0.1.7 • Public • Published

modal-react

github npmjs

Installation

npm i react-modal-ib
import { Modal } from 'react-modal-ib';

Example

how to use react-modal-ib

import React, { useState } from "react";
import { Modal } from "react-modal-ib";

export const App = () => {
    const [isShowing, setIsShowing] = useState(false);

    function toggle() {
        setIsShowing(!isShowing);
    }

    return (
        <div>
            <button onClick={toggle}>Open Model</button>
            <Modal isShowing={isShowing} modalMessage="Employee Created!" toggle={toggle}/>
        </div>
       
    );
};

there is also a custom style

const customStyle = {
  overlay: {
    backgroundColor: "red",
  },
  content: {
    borderRadius: "10px",
  },
  close: {
    margin: "5px 17px",
   fontSize: "14px",
  },
};

<Modal Showing={isShowing} modalMessage="Employee Created!" toggle={toggle}  style={customStyle} />;

Readme

Keywords

Package Sidebar

Install

npm i react-modal-ib

Weekly Downloads

1

Version

0.1.7

License

none

Unpacked Size

4.96 kB

Total Files

3

Last publish

Collaborators

  • imane-benamar