1.1.3 • Published 1 year ago

superstarmodal v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

superstarmodal

A simple modal component for React with Tailwind CSS.

Installation

Install the package using npm or yarn:

npm install superstarmodal

Usage

Import the Modal component and use it in your React project:

import { Modal } from 'superstarmodal';

const MyComponent: React.FC = () => {
  const [modalOpen, setModalOpen] = React.useState(false);

  return (
    <div>
      {/* ... Other content ... */}
      <button onClick={() => setModalOpen(true)}>Open Modal</button>

      <Modal open={modalOpen}>
        {/* Content of your modal */}
        <p>This is a modal!</p>
        <button onClick={() => setModalOpen(false)}>Close</button>
      </Modal>
    </div>
  );
};

Props

PropDescription
openA boolean indicating whether the modal should be displayed (true) or hidden (false).
childrenThe content to display inside the modal. This can include any React element or component.

Exemple Usage

Set theopen prop to true to display the modal. Provide the desired content within the children prop (e.g., text, buttons, forms).

<Modal open={modalOpen}>
  <p>This is a modal!</p>
  <button onClick={() => setModalOpen(false)}>Close</button>
</Modal>

License

This project is licensed under the MIT License - see the LICENSE file for details. Customize the content as needed for your specific package.

1.1.1

1 year ago

1.1.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.2

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago