Dynamic Themes - Dark Mode

Hey team,

Would be super cool to allow editors to pass in value for theme so it could be dynamically changed.

I.e.

  • you have light, custom and dark theme

  • you store user preferences via Retool API within metadata

  • reference metadata to choose a theme across all apps

Hi @stefancvrkotic thanks for reaching out!

Actually, I believe that there is a feature that was just recently released that does this! The latest edge release of Self-Hosted retool is also available to cloud users and is outlined here. I think that what you're interested in is this line: "Added a JS API theme.setMode() to dynamically change app themes during a user session. (#47667)"

1 Like

Hi @polly is there any documentation on how to use the JS api you mention?

Is it possible to use it in retool cloud? If so, how?

Been trying to use this function without any luck and the lack of documentation is not helping either

Hi @juan_posada,

Apologies for the confusion here! The new themes feature is still in Private Beta. I'm happy to enable it for you if you'd like. During private betas, we are particularly interested in collecting lots of product feedback as we move towards general availability.

Should I go ahead and add the feature? Once it is enabled, you'll get access to the new themes editor shown here. You can create any number of "modes" in the top right corner of the editor. Then, in an app that has your theme enabled, you can run a Javascript query to switch modes:

For folks following along, themes are only available on Business & Enterprise plans

Hi @Tess, thanks for your response, if you want we can keep our convo through DM, but yes, it would be great if you can enable the feature for my org!

Np, added the feature! Let us know if any questions/feedback come up

1 Like