2.0.3 • Published 3 years ago

@achtaitaipai/modal-reactjs-component v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

NameTypeDescription
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

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago