A React responsive modal component that displays a message with options
npm install p14-react-modal-derrahi 

``bash`
npm install --save p14-react-modal-derrahi
| Prop | Type | Description |
|-------------------|-------------|---------------------------------------------|
| icon | String | URL for the icon displayed in the modal |message
| | String | Message displayed in the modal |buttonText
| | String | Text for the action button |onClose
| | Function | Callback to close the modal |onButtonClick
| | Function | Callback for the button action |className
| | String | CSS class to customize the modal |
`jsx
message="Your message here"
buttonText="Button text"
onClose={() => console.log('Modal closed')}
onButtonClick={() => console.log('Button action')}
className="your_css_class"
buttonColor="color"
/>
`
- Handles key events (Escape, Enter) for modal interaction.
`jsx
import React, { useState } from 'react';
import Modal from 'p14-react-modal-derrahi';
function Example() {
const [isOpen, setIsOpen] = useState(false);
const openModal = () => { setIsOpen(true) };
const closeModal = () => { setIsOpen(false) };
return (
export default Example;
`Peer Dependencies
The p14-react-modal-derrahi component has the following peer dependencies:
`bash``
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
MIT © Halima-DERRAHI