1.0.22 • Published 7 months ago

pa-react-modal v1.0.22

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Installation

npm i pa-react-modal

Example

import MyModal from 'pa-react-modal';
import { useState } from 'react';

const AppModal = () => {
  const [isOpen, setIsOpen] = useState(false);

/**
 * Modal component that displays content in a modal dialog.
 * 
 * You can add as many as children you want to and edit css as you please in your application
 * 
 * @component
 *
 * @param {boolean} isOpen - Determines whether the modal is open or closed.
 * @param {Function} onClose - Function to close the modal when called.
 * @param {ReactNode} children - The content to be displayed within the modal.
 * @returns {ReactElement|null} - The modal component or null if it is closed.
 */
  return (
    <div>
      <button onClick={() => setIsOpen(true)}>Open Modal</button>
      <Modal isOpen={isOpen} onClose={() => setIsOpen(false)}>
        <h1>My Modal Content</h1>
        <p>Vous pouvez cliquer sur la croix</p>
      </Modal>
    </div>
  );
};

export default AppModal;
1.0.22

7 months ago

1.0.21

7 months ago

1.0.20

7 months ago

1.0.19

7 months ago

1.0.18

7 months ago

1.0.17

7 months ago

1.0.16

7 months ago

1.0.14

7 months ago

1.0.13

7 months ago

1.0.12

7 months ago

1.0.11

7 months ago

1.0.10

7 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.0

7 months ago