# Theme Toggle > A button that switches between light and dark mode. Source: https://native.shellui.dev/docs/components/utility/theme-toggle ## Installation ```bash shellui-native add theme-toggle ``` **Platforms:** MAUI ยท Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=theme-toggle-basic) From code, `ShellTheme` does the same: ```csharp ShellTheme.ToggleTheme(); var dark = ShellTheme.IsDarkMode; ``` ## API | Event | Arguments | Description | |---|---|---| | `ThemeChanged` | `bool` | The theme switched between light and dark. | | Method | Description | |---|---| | `Toggle()` | Opens it if closed, closes it if open. |