0.1.2 • Published 2 years ago
my-modal-maxencec v0.1.2
React Modal
A simple modal build with React
Features
- Display custom text in a modal
- Close when clicked outside
Installation
To install, you can use npm or yarn:
$ npm install my-modal-maxencec
$ yarn add my-modal-maxencec
Usage
The component needs two props:
Props | Types | Required | Default | Description |
---|---|---|---|---|
isOpen | Boolean | ✅ | Indicates if the modal shoould be open or closed | |
SetIsOpen | Function | ✅ | Change isOpen state | |
text | String | ✅ | Text displayed by the modal |
import { Modal } from "my-modal-maxencec"
import "my-modal-maxencec/dist/style.css"
function App() {
return (
<div className="App">
<Modal isOpen={modalIsOpen} setIsOpen={setModalIsOpen} text="User created!" />
</div>
)
}
export default App