Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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()}>ouvrir

console.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 |