@aminarji/hrnet-modal-react
v1.0.2
Published
Student project modal.
Downloads
231
Maintainers
Readme
@aminarji/hrnet-modal-react
Modal for HRnet project.
Prerequisites & Requirements
- Node.js:
>= 18.0.0 - React:
^18.0.0 - React DOM:
^18.0.0
Installation
npm install @aminarji/hrnet-modal-reactUsage
import { useState } from 'react';
import { Modal } from '@aminarji/hrnet-modal-react';
function App() {
const [isOpen, setIsOpen] = useState(false);
return (
<div>
<button onClick={() => setIsOpen(true)}>Open Modal</button>
<Modal isOpen={isOpen} onClose={() => setIsOpen(false)} title="Confirmation">
<p>Employee created successfully!</p>
</Modal>
</div>
);
}Props
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| isOpen | boolean | false | Controls whether the modal is visible or hidden. |
| onClose | function | (required) | Callback function called when the user closes the modal. |
| title | string | "" | Optional text to display in the modal header. |
| children | node | - | Content placed inside the modal body. |
| closeOnEsc | boolean | true | Allows closing the modal by pressing the Escape key. |
| closeOnOverlayClick | boolean | true | Allows closing the modal when clicking outside on the background overlay. |
| className | string | "" | Optional extra CSS class name for custom styling. |
