Can i set the dark theme in Streamlit?

I tried to apply the dark theme in my (private) space,
using Streamlit configuration.

I created the config.toml file with the following content:


But the space doesn’t update the theme.

Is it possible to change the theme? Do you have any suggestions?

Looks like the config.toml file doesn’t get picked up. One quick way to solve your issue is to change your theme to dark in your user settings on the site here.

1 Like

Excellent advice for the moment.
It’s probably not the ultimate and cleanest solution, since I can’t have different themes on different spaces.
Thank you!

1 Like

Agreed - I’ll make sure the team knows about this issue to see if we can add config.toml support or something similar.

1 Like

Unfortunately setting my theme to dark solves the problem only for me. :sob:
If another user enters my space with a light theme, he sees it with his light theme.

The reason behind that decision was to make the UI of the space match the UI of the Hub. If the user is in dark theme, forcing a light theme can annoy that user. Likewise, if user is using light theme, forcing a dark theme can cause same effect.

I think we do allow this with Gradio though and it might be an option we should explore. cc @cbensimon @julien-c @victor

Contrary to what their documentation states, the .streamlit/config.toml file in the project is not getting picked. But ~/.streamlit/config.toml is (the one in your home directory). You can set the base theme there.

Another option would be to pass --theme.base dark in the command line when you run your app.