Skip to main content

setThemeMode(mode)

Changes Command AI experiences to use the supplied theme mode ("light_mode", "dark_mode", or "auto")

Examples

Automatically detect user's system preferences

window.CommandBar.setThemeMode("auto");

Set dark mode

window.CommandBar.setThemeMode("dark_mode");

Set light mode

window.CommandBar.setThemeMode("light_mode");

Method parameters

mode Required

"light_mode" | "dark_mode" | "auto"

Using "light_mode" or "dark_mode" will trigger the light / dark mode of your default Command AI theme. Using "auto" will set light or dark mode according to each end user's system preferences. The default mode is "light_mode".