Skip to content

dialog-fn

One promise-dialog core, every framework. Open a dialog, await the result.

Confirm

Why dialog-fn

Every framework

The same promise-dialog model and identical semantics across React, React Native, and Svelte — from one tiny core.

~1 KB, zero deps

Built on native primitives (React’s useSyncExternalStore, Svelte stores). Nothing to bundle but your own component.

No providers

No context wrapper to mount. show() is a plain function — call it from handlers, services, or anywhere.

Promise-based

const res = await show(data) resolves the confirm value, or undefined when dismissed. It never rejects — no try/catch.

Same behavior, two frameworks

// React
const { Dialog, show } = createDialog(MyDialog);
const res = await show({ name: "Ada" });
if (res) save(res);
<!-- Svelte -->
<DialogRegister
dialogComponent={MyDialog}
bind:showDialog
/>
const res = await showDialog({ name: "Ada" });

Bring your own component — dialog-fn only controls visibility and the promise. Head to Getting started or jump into a recipe.