use-popup
v1.0.2
Published
React Popup Component with Hooks
Downloads
1
Readme
use-popup
use-popup is a react popup component that let you easily create a popup and control it with flexibility.
Installing
npm install use-popup --save
or
yarn add use-popup
Using
You only need to import the use-popup to use it. You can trigger showPopup anywhere in your aplication.
import { useEffect } from 'react';
import usePopup from 'use-popup'
export default function Home() {
const { Popup, showPopup } = usePopup();
useEffect(() => {
showPopup({
title: 'Error :(',
message: 'Your reqeuest failed, try again!',
color: 'red',
seconds: 5
})
}, [])
return (
<Popup />
);
}
Show Your Support
If you enjoyed this project, please the repo to show your support. Feel free to give feedback and make a pull request.