my-modal-maxencec
v0.1.2
Published
A simple modal build with React
Readme
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-maxencecUsage
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
