DialogHost
Programmatic modals via useDialog()
Renders dialogs opened from code with useDialog() — a confirm from a store action, a form in a modal without a component in the template. Mount one per app, near the root.
Basic
result: —
useDialog()
ts
const { open, close } = useDialog();
const result = await open<string>({ title, component, props, size, dismissible });
const ok = await open({ title, text: "plain body" });The component gets your props plus a close(result) prop; open() resolves with that result, or undefined when dismissed.
- Each dialog is a Modal, with its focus handling and Esc.
Usage
ts
import { BlessDialogHost } from "blessing-ui";