A library for handling overlays more easily in React.
A library for handling overlays more easily in React.
overlay-kit is a library for declaratively managing overlays like modals, popups, and dialogs in React.
You can efficiently implement overlays without complex state management or unnecessary event handling.
npm install overlay-kitFirst, add provider:
import { OverlayProvider } from 'overlay-kit';
const app = createRoot(document.getElementById('root')!);
app.render(
);You can easily open and close overlays using overlay.open.
import { overlay } from 'overlay-kit';
{
overlay.open(({ isOpen, close, unmount }) => (
))
}}
>
Open
You can handle overlay results as a Promise using overlay.openAsync.
import { overlay } from 'overlay-kit';
{
const result = await overlay.openAsync(({ isOpen, close, unmount }) => (
close(true)}
onClose={() => close(false)}
onExit={unmount}
/>
))
}}
>
Open
MIT © Viva Republica, Inc. See LICENSE for details.
No open issues yet, or sync has not completed.