Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@jtech-works/dialog

A lightweight, customizable modal/dialog provider using React Context API. Easily control dialogs across your app using a simple show() and close() interface.

react, dialog, modal, context, react-context, provider, component, popup, overlay, ui

readme

Dialog Context

A lightweight, customizable modal/dialog provider using React Context API. Easily control dialogs across your app using a simple show() and close() interface.

✨ Features

  • ⚙️ Context-based API with show() and close()
  • 🎨 Customizable: width, background, color, padding, shadow
  • 🎞️ Built-in animations: bounce, opacity, scale, or plain
  • 🖱️ Optional click-outside and ESC-to-close behavior
  • 🧼 Automatic CSS injection (no manual styles needed)

📦 Installation

  1. Copy DialogContextProvider.tsx to your project.
  2. Wrap your root or layout component with it.

🚀 Usage

1. Wrap your app with the provider

`tsx import DialogContextProvider from '@jtech-works/dialog'; import App from './App';

export default function Root() { return ( <DialogContextProvider width="500px" background="#fff" color="#000" closeOnClickOutside closeOnClickEsc padding="1rem" animation="bounce" > <App /> </DialogContextProvider> ); }