2.0.5 • Published 3 years ago

@jsmine/react-popup-utils v2.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

react-popup-utils

A react component which can be used as wrapper for any popup. This component easily detects mouse clicks done on its wrapped element or out side and triggers the call back. It also triggers callback on esc key and on timeout.

Example

Getting Started

install the react-popup-utils via npm:

npm i @jsmine/react-popup-utils

import it in your file:

import PopupUtils from '@jsmine/react-popup-utils

wrap your popup:

<PopupUtils closePopup={()=>'your popup close handler'}>
    <div>popup</div>
</PopupUtils>

Props

propstypedefault valuedescription
closePopupfunctionnonefunction passed in this prop will be called on getting clicked or on other callback triggers
closeOnSelfClickboolfalseif set true, popup close handler will trigger even on getting clicked on wrapped element
closeOnClickOutSidebooltrueif set false, popup close handler will not trigger
closeOnEscapebooltrueif set true, popup close handler will trigger on clicking esc key
setTimeoutboolfalseif set true, popup close handler will trigger after specified time
timeoutTimenumber1500 millisecondsit takes timeout time in millisecond
2.0.5

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago