Skip to content
Discussion options

You must be logged in to vote

Hi @brunnenhof,

I'd recommend binding both ui.dark_mode and ui.switch against app.storage.user:

ui.dark_mode().bind_value(app.storage.user, 'dark_mode')
...
ui.switch('Dark Mode').bind_value(app.storage.user, 'dark_mode').props('color=white')

Note that I chose "color=white". Otherwise the color turns "primary" when activating the switch, so the switch would be invisible on the "primary"-colored header.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by brunnenhof
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants