{"version":"v1.0","client_state":{"Studio.default":{"fields":{"primary":"#682747","secondary":"#3a52b0","success":"#2f9e64","warning":"#f0a91b","error":"#e5484d","info":"#0e9bc4","background":"#fafafa","surface":"#ffffff","interface":"#f0f0f1","text":"#171717","muted":"#6b6b6e","d_primary":"#682747","d_secondary":"#3a52b0","d_success":"#2f9e64","d_warning":"#f0a91b","d_error":"#e5484d","d_info":"#0e9bc4","d_background":"#0a0a0a","d_surface":"#151515","d_interface":"#212121","d_text":"#f5f5f5","d_muted":"#a0a0a3","spacing":0.1875,"box":0.75,"field_":0.75,"selector":0.375,"stroke":1.0,"font":"ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'"},"persist":"local","send_to_server":true},"ColorScheme.default":{"fields":{"mode":"system"},"persist":"local","send_to_server":true}},"endpoints":{"action":"/_bretzel/action","sse":"/_bretzel/sse","refetch":"/_bretzel/refetch"},"csrf":"89e6e4eb5c676647a9de365b20ea90c5","page_id":"493c6089d9ab481a95fab7765fbf4624","address":""}
ui.dialog

Dialog

A centred modal with backdrop, Escape and focus trap — opened with .open(), closed from any button inside it.

Confirm a destructive action

The dialog is declared once; the trigger calls dialog.open() and every button inside can call dialog.close(). No state to declare.

One confirmation per row

A list on on_click runs the Python handler AND closes the dialog at once; the list re-renders when the key is gone.
Production
Staging
CI pipeline

A form in a dialog

persistent=True keeps the close button but ignores Escape and the backdrop, so a stray click never loses a half-typed form. The handler receives the typed form state.

Team

Widths

sm, md (the default), lg and xl.

An answer is required

dismissible=False removes the close button, Escape and the backdrop click: only the buttons inside can close it.