---
title: "Turn on dark mode for the messenger"
description: "Give the messenger separate light and dark colours so it follows your website's theme or the phone's setting, or set the mode from your code."
url: https://help.gleap.ai/de/articles/16751987-turn-on-dark-mode-for-the-messenger
collection: "Messenger"
updated: 2026-11-13
language: de
alternates: [en]
---

# Turn on dark mode for the messenger

Give the messenger separate light and dark colours so it follows your website's theme or the phone's setting, or set the mode from your code.

The messenger can follow your product's theme: light colours on a light page, dark colours on a dark one. On websites it picks up the theme your site uses, and in mobile apps it follows the phone's light or dark setting. You set the dark colours once, and the switch happens on its own.

### Set up dark mode

1.  Open **Settings → Widget → Look**.
    
2.  Turn on **Match light and dark mode**.
    
3.  Under **Brand**, select **Dark**.
    
4.  Choose **Generate from light mode** for a starting point, or set the dark colours and assets yourself.
    
5.  Check both modes using the preview’s light and dark controls. Changes save automatically.
    

The messenger now uses your dark colours whenever your site or app is dark.

![Match light and dark mode switch and theme controls in the Pied Piper demo project.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/Jz2EYPyLUWnxwOJvVIY9EycQmyL9biMtZ92buxqRQshr3c5ypuejJNTkSM9wohHgY8gGV3OqHUu.png)

Each mode has its own header colours, UI colour, background colour, header logo, background image and composer glow colours. A colour without a dark value keeps its light one, and the button colour is the same in both modes. The launcher, notifications, info cards, the AI chatbar and checklists switch along with the messenger. If a colour is hard to read on the background, Gleap warns you and suggests a better one.

### How the messenger decides

-   **Websites**: the messenger looks for your site's theme in this order: a dark or light marker on the page (such as a `dark` class or a `data-theme` attribute), the page's CSS `color-scheme`, the page's background colour, and finally the visitor's system setting. When your site switches theme, the messenger switches with it.
    
-   **iOS**: it follows your app's interface style, including a style you force in the app.
    
-   **Android**: it follows your app's night mode.
    

> **Info:** Dark mode needs SDK 19.0.0 or newer on every platform. Update the SDK in your app if the messenger stays light.

### Set the mode from your code

If your product has its own theme switch, tell the messenger which mode to use. This overrides the automatic detection:

```javascript
// "auto", "light" or "dark"
Gleap.setColorScheme("dark");

// Optionally match your own background colours
Gleap.setColorScheme("auto", {
  lightBackgroundColor: "#ffffff",
  darkBackgroundColor: "#0b0b0f",
});
```

You can call it before or after `Gleap.initialize`. iOS, Android, Flutter, React Native and Capacitor have the same method; see the dark mode guide for your SDK in the developer documentation.

> **Warning:** `setColorScheme` does nothing while **Match light and dark mode** is off. Turn the switch on first.

### Related

-   [Design your messenger](https://help.gleap.ai/en/articles/269-design-your-messenger.md)
    
-   [Control the messenger from your code](https://help.gleap.ai/en/articles/364-control-the-messenger-from-your-code.md)
    
-   [Place the launcher button](https://help.gleap.ai/en/articles/271-place-the-launcher-button.md)
