set_appearance_mode()
Set the appearance mode for the entire application.Parameters
The appearance mode to set. Available options:
"light"- Force light mode for all widgets"dark"- Force dark mode for all widgets"system"- Automatically follow the system’s appearance mode (default)
Behavior
- When set to
"system", CustomTkinter automatically detects and follows your operating system’s appearance mode - Changes apply immediately to all existing CustomTkinter widgets
- The setting persists for the lifetime of the application
- System mode is monitored continuously and updates automatically when the OS theme changes
get_appearance_mode()
Get the current appearance mode state.Returns
Type:str
Returns the current active appearance mode:
"Light"- Application is currently in light mode"Dark"- Application is currently in dark mode
"system", this function returns the actual resolved mode (“Light” or “Dark”), not “system”.
Example
Notes
- System appearance mode detection requires the
darkdetectpackage, which is installed automatically with CustomTkinter - On macOS and Windows, system mode detection works automatically
- On Linux, system mode detection may have limited support depending on the desktop environment
- The appearance mode is separate from the color theme (set via
set_default_color_theme()) - Appearance mode affects whether widgets use their light or dark color variants from the active theme