@linzjs/windows
v8.2.1
Published
[](https://github.com/semantic-release/semantic-release)
Downloads
4,299
Readme
@linzjs/windows
Reusable promise based windowing component for LINZ / Toitū te whenua.
React state based modals/windows are painful because they require:
- shared states for open/closed.
- callbacks/states for return values.
- inline modal/window includes, which prevent you from closing the invoking component before the modal/window has completed.
This module gives you promise based modals/windows which don't require all the state based boilerplate / inline-components.
So you can simply do this in your react-app:
const result = await showModal(TestModal, { props... })
<button onClick={() => openPanel({ componentFn: () => <Panel.../>, onClose=onClose)}>
Open panel
</button>Features
- Async HTML dialog based Modals.
- Draggable and resizeable, pop-in/out Panels/Windows.
Install
npm install @linzjs/windowsor with Yarn
yarn add @linzjs/windowsDebug log
To enable debug logs set:
localStorage.setItem("@linzjs/windows.debugEnabled", "true");Demo
npm run storybookSee Chromatic storybook for documentation.
