ui-kit-htx previewGitHub
← display

theme_toggle

4 stories — source: theme_toggle.greg.py

default

Standalone toggle button — drop into any chrome (SuiteHeader, settings page, modal). Requires ThemeBootScript() in <head> and ThemeScript() in <body> to actually persist + apply.

pre-pressed

Server-side theme detection: pre-stamp `pressed=True` so the initial render shows the correct aria-pressed state before ThemeScript boots.

custom-storage-key

Multi-tenant or scoped-theme apps: pass a custom storage_key (must match ThemeBootScript / ThemeScript values).

full-page-with-runtime

Click the toggle — try reloading after switching.
End-to-end: BootScript + ThemeScript + ThemeToggle. Click the button to flip the dark class on <html>.