1.0.8 • Published 2 years ago

modal-react-library v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

A simple & lightweight method of displaying modal windows with React

Installation

In the project directory, you can run:

npm i modal-react-library

Import

You have to import Modal component in your application

import { Modal } from "modal-react-library"

Initialization

Use the modal like a React component

You have to initialize the Modal with useState

const [modalIsActive, setModalIsActive] = useState(false)

Render

You can render the modal in your component with

{modalIsActive && (<Modal buttonType="submit" buttonText="SUBMIT" htmlTextModal="bonjour" modalIsActive={modalIsActive} handleActiveModal={setModalIsActive} /> )}

Params

buttonType: "button" | "submit" | "reset"
buttonText: string of the text on the button
htmlTextModal: string of the text on the modal
modalIsActive: boolean
handleActiveModal: useState function

Example

alt text

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago