2.0.3 • Published 2 years ago
@achtaitaipai/modal-reactjs-component v2.0.3
A small but functional npm package
Install
npm install @achtaitaipai/modal-reactjs-component
yarn add @achtaitaipai/modal-reactjs-component
Usage
import { useRef } from 'react'
import Modal from 'Modal'
function App() {
const modalRef = useRef()
return (
<div>
<button onClick={() => modalRef.current.open()}>ouvrir</button>
<Modal ref={modalRef} title="titre" message={'message'} onClose={() => console.log('close')} onConfirm={() => console.log('confirm')} confirmBtn={'Ok'}>
<p>Content of the modal</p>
</Modal>
</div>
)
}
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 |
2.0.3
2 years ago
2.0.2
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
1.1.1
2 years ago
1.1.0
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
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago