npm.io
1.0.5 • Published 3 years ago

dragovic-modal-package

Licence
ISC
Version
1.0.5
Deps
2
Size
152 kB
Vulns
0
Weekly
0

modal-package

Npm package to add a react Modal component

Prerequisites

This project requires React and NPM. To make sure you have them available on your machine, try running the following command.

$ npm -v

Getting Started

These instructions will get you up and running on your local machine.

Installation

Here is the link of the npm folder: https://www.npmjs.com/package/dragovic-modal-package?activeTab=readme

Start with adding the package on your local machine:

$ npm install dragovic-modal-package

Usage

Import and setup the package

Import the package:

$ import { Modal } from 'dragovic-modal-package';

Add the state to control if the modal is visible or not ( Default to false ):

const [show, setShow] = useState(false);

Then add the modal component to the page:

<Modal title='' onClose={ ()=> setShow(false) } show={ show } />
Customization

You can change the content inside the modal by adding a title. Exemple:

<Modal title='Employee created' onClose={ ()=> setShow(false) } show={ show } />

Author

Keywords