Skip to content

VEBoris/react-modal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

##Description :

a modal pluggin for react

##Installation :

npm install --save veb-modal

##Usage :

The Modal component needs 5 props :

{text} : the text to display in the modal
{closeModal} : the function to close the modal (you have to add it closing function in your file)
{styleModalBody} : the style of the modal
{styleButton} : the style of the button
{styleText} : the style of the text

##Example :

import React, { useState } from 'react' import Modal from 'veb-modal' import 'react-modal-component-library/dist/index.css'

function Example () { const [modalVisible, setModalVisible] = useState(false);

const openModal = () => {
    setModalVisible(true);
};

const closeModal = () => {
    setModalVisible(false);
};

return (
  <div> 
    <button onClick={openModal}> Open Modal </button>
    {modalVisible && <Modal text="Employee Created !" closeModal={closeModal} />}
  </div>
)

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published