This guide addresses how to toggle between different themes in Panel.
theme of a Panel app primarily determines the color scheme of our application. By default there are ‘default’ (i.e. light) and ‘dark’ themes defined in Panel and we can toggle between them by setting the
import panel as pn pn.config.theme = 'dark'
config options can also be set via the extension, e.g. to set the theme use
Note that if you do not explicitly override the theme it will default to a light theme. The theme can also be overridden with by setting
theme as a URL query parameter for your application, i.e. if your app is hosted at
?theme=dark will switch the theme automatically.
The theme will apply to all components and combines with the design to provide a consistent visual language.
In JupyterLab and when using the pydata-sphinx-theme Panel components will automatically adapt to the global CSS variables, regardless of what theme you set.