ToolCall and ShowToast to build these patterns.
Confirmation Dialog
Wrap a destructive trigger in a Dialog so users must confirm before the action fires. The first child is the trigger element; the remaining children form the dialog body. The Cancel button closes the dialog automatically — no extra wiring required.Two-Step Destructive Actions
Some destructive actions need to show the user what will happen before they confirm. Combine a Dialog withShowToast callbacks to give feedback after the server responds.
Two-Step Confirmation
on_success and on_error callbacks on ToolCall fire after the server tool completes, giving the user immediate feedback without additional logic.
Toast Feedback
ShowToast works on any ToolCall action, with or without a dialog. Use it whenever users need to know whether a server action succeeded.
Toast variants: "success", "error", "warning", "info", or omit for default styling.