1.0.22 • Published 2 years ago

pa-react-modal v1.0.22

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago