0.3.2 • Published 1 year ago

modal-component-library-p14 v0.3.2

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

Presentation

Modal component library is a modal library. It's goal is to provide easy, flexible, configurable and accessible way to display modals for your application.

Authors

Screen

img

Installation

    npm i modal-component-library-p14

Usage

Import Modal component from "modal-component-library" where you want to use this

import React, { useState } from "react";
import ModalComponent from "modal-component-library-p14";

function App() {
  const [ModalIsVisible, setModalIsVisible] = useState(false)
  const closeModal = () => { setModalIsVisible(false) }
  return (
    <div className="App">      
        <ModalComponent text="your message" closeButton={closeModal} visible={ModalIsVisible} />
        <button onClick={() => setModalIsVisible(true)}>Open Modal</button>     
    </div>
  );
}

Props

NameTypeRequiredDescription
visiblebooleantrueDisplay the modal
closeButtonfunctrueThe function to close the modal
textstringtrueMessage to show