Dash Bootstrap theme light / dark switcher with toggle?

Hello,

I’m working on Python.

I would like to find a way to switch my app Bootstrap theme from one light theme (‘FLATLY’) to a dark one (‘DARKLY’) by using a dash_daq.ToggleSwitch (if possible).

I saw in another topic a solution using Dropdown, but was not able to adapt it.
#50798

If you have any idea, it would be very appreciated
Thanks

1 Like

Hi @bebio95

Here is a minimal example that switches themes with a toggle switch.

Check out the figure templates in dash-bootstrap-templates library. It makes it easy to style graphs with a Bootstrap theme.

When switching between light and dark themes, you may need some additional CSS to make things like the dash DataTable and dash core components visible in both light and dark themes. See more information in my Dash Bootstrap Theme Explorer app



theme_switch_toggle

7 Likes

Hi,

Thank you very much. That’s exactly what I wanted.
The links are also very useful to me.