an_modal
v0.0.7
Published
--- openModal, CloseModal,
Downloads
1
Readme
Usage
Modal
ModalHeader
ModalBody
ModalFooter
Modal
--- openModal, CloseModal,
ModalHeader
--- mtitle
<Modal openModal={modalOpen} CloseModal={CloseModal}>
<ModalHeader mTitle={"Do you want to delete this file ? "}></ModalHeader>
<ModalBody>
<div>
username with ramya
</div>
</ModalBody>
<ModalFooter>
<button onClick={CloseModal}>cancel</button>
</ModalFooter>
</Modal>
Re-usable Modals Agenda: · What are the reusable modals and why is it required? · Pros and Cons of re-usable modal · Technologies used for Re-usable modal. What is the Re-usable modal? A reusable modal is a modal component that can be reused throughout a website or application, rather than having to be recreated from scratch every time it's needed. This can save time and effort for us and help to ensure consistency in the design and functionality of the modals across the site or app. Requirement of Re-usable modals: Some general requirements for creating reusable modals could include:
- Flexibility: The modal should be able to handle different types of content, such as text, images, and videos, and should be customizable to fit different design needs.
- Accessibility: The modal should be accessible to all users, including those with disabilities.
- Compatibility: The modal should work across different browsers and devices and should be responsive to different screen sizes.
- Reusability: The modal should be designed in a way that makes it easy to reuse across different pages and sections of a website or application.
- Maintainability: The modal should be easy to maintain and update, with well-organized and modular code.
- Performance: The modal should be designed in a way that minimizes its impact on page load times and overall website or application performance.
Pros and Cons of Re-usable modals: Pros:
- Consistency: Reusable modals can ensure consistency in the design and functionality of modals across a website or application. This can help create a more cohesive user experience and make it easier for users to understand and interact with modals.
- Reusability: Reusable modals can save time and effort for us by allowing them to reuse existing code rather than having to recreate modals from scratch every time they're needed.
- Maintenance: By using reusable modals, we can make updates and changes to the code in one place and have those changes reflected across all instances of the modal on the website or application.
- Flexibility: Reusable modals can be designed to be flexible and customizable, allowing them to be adapted to different use cases and design needs. Cons:
- Complexity: Creating reusable modals can require a higher level of skill and expertise than creating modals for a specific use case. This can make it more difficult for less experienced developers to create effective reusable modals.
- Compatibility: Ensuring that reusable modals work across different browsers and devices can be challenging and may require additional testing and development time.
- Performance: Reusable modals can add extra code to a website or application, which can negatively impact page load times and overall performance if not optimized correctly.
- Dependencies: Reusable modals may rely on external libraries or frameworks, which can add extra complexity and potential compatibility issues. Technologies used for Re-usable button:
- HTML
- CSS
- React Js How to publish a package in npm? To publish a modal package in npm, you can follow these general steps:
- Create a new project directory: Create a new directory for your modal package and initialize it using npm by running the command npm init.
- Write our modal code: Write the code for our modal and any necessary dependencies. Make sure to follow best practices for creating reusable and maintainable code.
- Create a package.json file: Create a package.json file in the root directory of our project. This file contains information about our package, such as its name, version, description, and dependencies.
- Publish our package: Once we're ready to publish our package, we can use the npm publish command to publish it to the npm registry. Note that we’ll need a npm account and must be logged in to our account in our terminal in order to publish our package.
- Maintain our package: Once our package is published, we can continue to maintain and update it as needed by making changes to our code and updating the version number in our package.json file.