Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/achtaitaipai/modal-reactjs-component
A small but functional npm package
https://github.com/achtaitaipai/modal-reactjs-component
Last synced: about 2 months ago
JSON representation
A small but functional npm package
- Host: GitHub
- URL: https://github.com/achtaitaipai/modal-reactjs-component
- Owner: achtaitaipai
- Created: 2022-03-13T13:31:12.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-19T08:27:42.000Z (almost 3 years ago)
- Last Synced: 2024-04-18T08:32:23.586Z (9 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@achtaitaipai/modal-reactjs-component
- Size: 368 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## A small but functional npm package
### Install
npm install @achtaitaipai/modal-reactjs-component
yarn add @achtaitaipai/modal-reactjs-component### Usage
```jsx
import { useRef } from 'react'
import Modal from 'Modal'function App() {
const modalRef = useRef()
return (
modalRef.current.open()}>ouvrirconsole.log('close')} onConfirm={() => console.log('confirm')} confirmBtn={'Ok'}>
Content of the modal
)
}export default App
```#### Props
| Name | Type | Description |
| ---------- | ---------- | ---------------------------------------------------- |
| title | 'String' | Modal's title |
| confirmBtn | 'String' | Confirm button's content |
| onClose | 'Function' | Function to execute when the user closes the modal |
| onConfirm | 'Function' | Function to execute when the user confirms the modal |