Skip to content

ConfirmProvider

ConfirmProvider(__namedParameters): Element

Defined in: packages/ui/src/components/confirm-provider.tsx:32

Provides the useConfirm context and renders the confirmation dialog.

Wrap your application (or a subtree) with ConfirmProvider to enable the imperative useConfirm() hook. The dialog is rendered using the UI plugin’s confirmDialog slot, so it matches your chosen component library.

ReactNode

Element

// In your root layout:
<ConfirmProvider>
<App />
</ConfirmProvider>
// In any descendant component:
const confirm = useConfirm();
const ok = await confirm({ title: "Delete?", variant: "danger" });