0.0.7 • Published 1 year ago

an_modal v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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: 1. 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. 2. Accessibility: The modal should be accessible to all users, including those with disabilities. 3. Compatibility: The modal should work across different browsers and devices and should be responsive to different screen sizes. 4. 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. 5. Maintainability: The modal should be easy to maintain and update, with well-organized and modular code. 6. 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: 1. 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. 2. 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. 3. 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. 4. Flexibility: Reusable modals can be designed to be flexible and customizable, allowing them to be adapted to different use cases and design needs. Cons: 1. 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. 2. Compatibility: Ensuring that reusable modals work across different browsers and devices can be challenging and may require additional testing and development time. 3. 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. 4. 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: 1. HTML 2. CSS 3. React Js How to publish a package in npm? To publish a modal package in npm, you can follow these general steps: 1. Create a new project directory: Create a new directory for your modal package and initialize it using npm by running the command npm init. 2. 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. 3. 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. 4. 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. 5. 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.

0.0.3

1 year ago

0.0.2

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.1

1 year ago