{"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},"ExportOptions.default":{"fields":{"advanced":false},"persist":"memory","send_to_server":true}},"endpoints":{"action":"/_bretzel/action","sse":"/_bretzel/sse","refetch":"/_bretzel/refetch"},"csrf":"1fd1a2e626197294627f51174ee5979a","page_id":"7922b7e683b24e3798c952fe406cdf4d","address":""}
ui.switch

Switch

An on/off rail for settings that apply at once — in the browser through a binding, or on the server through a handler.

A settings list

The usual layout: the setting explained on the left, the switch on the right.
MentionsWhen someone @mentions you in a comment.
Invoice paidEach time a customer settles an invoice.
Weekly reportA summary of revenue every Monday at 9:00.

Show more options

Bound to a ClientState, the switch shows the extra fields in the browser, with no request.

A switch that runs Python

on_change sends the new value to Python; the status below re-renders.
All systems normal
Everything is running. 1,284 people signed in today.

Sizes, colours, disabled