Skip to main content

Usage

Get started with React and REPopup in no time.

Quick Start

Here's a quick example to get you started, it's literally all you need:


import { Alert ,RepopupProvider} from 'repopup'
import {useState} from 'react';
import ReactDOM from 'react-dom';

function App() {
const [open,setOpen] = useState(false)
return <>
<button onClick={() => setOpen(true)}>Open</button>
<Alert variant='success' open={open} onClose={() => setOpen(false)} title="Success"/>
</>
}

ReactDOM.render(
<RepopupProvider>
<App />
</RepopupProvider>,
document.querySelector('#app'));