0.1.17 • Published 1 year ago

new-modal v0.1.17

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

Project-modal-react

Description

React modal plugin

Installation

Run the command:

npm i new-modal

How to use

1.import the plugin with:

import Modal from "new-modal"

2.import useState from react and use the following state:

import {useState} from 'react'
const [modal, setModal] = useState(false);
const toggleModal = () => {
  setModal(!modal);
}

3.Call the modal where you want to display it:

<Modal textModal ="your text" toggleModal={toggleModal}>

paste the following code for the css:

.btn-modal {
  padding: 10px 20px;
  display: block;
  margin: 100px auto 0;
  font-size: 18px;
}

.modal-content {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1.4;
  background: #f1f1f1;
  padding: 14px 28px;
  border-radius: 3px;
  max-width: 600px;
  min-width: 300px;
  z-index: 1;
  box-shadow: 7px 2px 36px 3px rgb(143 255 0 / 75%);
  -webkit-box-shadow: 7px 2px 36px 3px rgb(143 255 0 / 75%);
  -moz-box-shadow: 7px 2px 36px 3px rgba(143, 255, 0, 0.75);
  border: 4px solid #fff550;
  background: #ffffff;
  border-radius: 15px;
  -webkit-border-radius: 15px;
  -moz-border-radius: 15px;
  -ms-border-radius: 15px;
  -o-border-radius: 15px;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 7px;
}
.displayButton {
  display: none;
}
0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.14

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago