Gathering detailed insights and metrics for react-flash-modal
Gathering detailed insights and metrics for react-flash-modal
Gathering detailed insights and metrics for react-flash-modal
Gathering detailed insights and metrics for react-flash-modal
Modern and lightweight **React Easy Modal** component. Can be easily integrated into any project.
npm install react-flash-modal
Typescript
Module System
Node Version
NPM Version
JavaScript (86%)
CSS (11.11%)
HTML (2.89%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
2 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Feb 08, 2025
Latest Version
1.0.6
Package Id
react-flash-modal@1.0.6
Unpacked Size
52.62 kB
Size
15.31 kB
File Count
11
NPM Version
10.9.0
Node Version
22.11.0
Published on
Feb 02, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A lightweight and flexible React modal component with smooth animations and easy customization. Perfect for modern web applications. Can be easily integrated into any project. Can be easily integrated into any project.
Install via npm:
1npm install react-flash-modal
Install via yarn:
1yarn add react-flash-modal
1import { useState } from "react"; 2import { ModalPortal } from "react-flash-modal"; 3 4import "react-flash-modal/dist/modal.css"; // import CSS file (important) 5 6function App() { 7 const [modalIsOpen, setModalIsOpen] = useState(false); 8 9 // open modal 10 const openModal = () => { 11 setModalIsOpen(true); 12 }; 13 14 // close modal 15 const closeModal = () => { 16 setModalIsOpen(false); 17 }; 18 19 return ( 20 <> 21 <button onClick={openModal}>Open Modal</button> 22 23 <ModalPortal 24 isOpen={modalIsOpen} 25 onClose={closeModal} 26 background={{ 27 color: "#00000050", 28 blur: { size: "2px" }, 29 maxWidth: "", 30 zIndex: 2 31 }} 32 modalContent={{ 33 width: "60%", 34 isModalTop: { 35 visible: false, 36 name: "Modal name", 37 fontSize: "18px", 38 bgColor: "#012C6E", 39 textColor: "white", 40 radiusTopX: "12px", 41 padding: "15px 20px" 42 } 43 }} 44 > 45 {/* children */} 46 <div style={{ padding: "20px", position: "relative" }}> 47 <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}> 48 <div></div> 49 <span onClick={closeModal} className='modal-overlay-close'> 50 <svg xmlns="http://www.w3.org/2000/svg" fill="black" viewBox="0 0 24 24" width="19px" height="19px"><path d="M 4.7070312 3.2929688 L 3.2929688 4.7070312 L 10.585938 12 L 3.2929688 19.292969 L 4.7070312 20.707031 L 12 13.414062 L 19.292969 20.707031 L 20.707031 19.292969 L 13.414062 12 L 20.707031 4.7070312 L 19.292969 3.2929688 L 12 10.585938 L 4.7070312 3.2929688 z" /></svg> 51 </span> 52 </div> 53 54 <div style={{ display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "30px 0" }}> 55 <img src="https://static.vecteezy.com/system/resources/previews/026/994/650/non_2x/welcome-concept-friendly-team-happy-to-new-team-member-online-event-celebrate-meeting-greeting-modern-flat-cartoon-style-illustration-on-white-background-vector.jpg" width="150px" /> 56 <h2>Welcome to Modal Group</h2> 57 <div style={{ textAlign: "justify", fontSize: "16px" }}> 58 Lorem ipsum dolor sit, amet consectetur adipisicing elit. Est recusandae ipsum, ducimus maxime sint quam voluptates dolores, eum esse similique ullam molestias. Possimus deserunt corrupti commodi eaque, magnam minus eos cupiditate perferendis laudantium molestiae, tempore temporibus excepturi reiciendis velit libero voluptatum? Reprehenderit harum voluptatem consequuntur exercitationem pariatur et ab odit velit temporibus, consequatur tempora aperiam tempore sed ipsa asperiores nulla amet est at! Quod maiores iure nulla commodi quis? Harum totam sequi voluptate nisi cumque quae consectetur enim consequatur, quisquam sint autem aliquam at, corporis culpa, deserunt incidunt veniam repellat eveniet? Voluptas expedita ut fuga provident, maxime quidem facilis! Quas. 59 </div> 60 <div style={{ display: "flex", alignItems: "center", gap: "10px", marginTop: "20px" }}> 61 <button type="button" style={{ color: "black", border: "none", padding: "10px 40px", borderRadius: "5px", cursor: "pointer" }} onClick={closeModal}>Cancel</button> 62 <button type="button" style={{ background: "#012C6E", color: "white", border: "none", padding: "10px 40px", borderRadius: "5px", cursor: "pointer" }} onClick={closeModal}>Submit</button> 63 </div> 64 </div> 65 </div> 66 67 </ModalPortal> 68 </> 69 ) 70} 71 72export default App; 73
Click here to view. here
Prop | Description | Type | Default |
---|---|---|---|
isOpen | To open/close a modal. | boolean | false |
onClose | Function to be triggered when the modal is closed. | function | closeModal() |
background | For general background. | object | { color: "#00000050", blur: { size: "2px" }, maxWidth: "", zIndex: 2 } |
modalContent | To handle the general modal itself. | object | { width: "60%", isModalTop: {visible: false, name: "Modal name", ...} } |
children | Content inside the modal. | React Node | |
className | To add an additional class to a modal. | string | "" |
react-flash-modal
?Perfect for developers who need a flexible, easy-to-use modal component in React! 🚀
react-easy-modal, react-flash-modal, easy-react-modal, react-elevate-modal, react modal, modal component, react popup, easy modal, react dialog, modal with animation, lightweight modal, customizable modal, react-ui, modal for react, react easy modal, modal, react-smooth-modal, react-modal, react-lightbox-modal, react-awesome-modal, react-modern-modal, react-animated-modal, react-dialogx, react-glassy-modal, react-modal-pr"
To contribute or make changes, clone the repository and install dependencies:
1git clone https://github.com/hikmatjan1/react-easy-modal.git 2cd react-easy-modal 3npm install
Run the development server:
1npm run dev
React Easy Modal is open-source and available under the MIT License.
If you like this modal, please give it a star on the GitHub repository! ⭐
No vulnerabilities found.
No security vulnerabilities found.