1.0.11 • Published 2 years ago

super-modal-react v1.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Getting Started with Super Modal React Component

A Super Modal React component that allows you to display content in a modal window.

To install the component, use npm or yarn:

In the project directory, you can run:

npm install super-modal-react

Usage

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

`import React, { useState } from 'react'; import Modal from 'react-modal-component';

const App = () => { const isOpen, setIsOpen = useState(false);

const handleOpenModal = () => { setIsOpen(true); };

const handleCloseModal = () => { setIsOpen(false); };

const modalContent = () => { return This is the content of the modal.; };

return (

<div>
  <button onClick={handleOpenModal}>Open Modal</button>
  <Modal isOpen={isOpen} setIsOpen={setIsOpen} content={modalContent} title="Modal Title" />
</div>

); };`

Props

The Modal component accepts the following props:

isOpen (boolean) - Determines if the modal is open or closed. setIsOpen (function) - A function that sets the isOpen state of the modal. content (function) - A function that returns the content to be displayed in the modal. title (string) - The title of the modal.

Styling

The Modal component uses the Modal.css file for styling. You can customize the styling by editing this file or by applying custom CSS classes to the modal elements.

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.1

2 years ago

1.0.0

2 years ago