> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deskhoot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Light or dark

> Match your website's theme

The chat uses the theme you chose under [**Customize**](https://app.deskhoot.com/app/channels?tab=widgets\&page=customize). Change it from your own code when your website has its own light and dark switch.

```js theme={null}
await DeskHoot.setTheme("dark");
```

## What you pass

**theme** `"light" | "dark" | "system"` *required*

* `"light"`: always light.
* `"dark"`: always dark.
* `"system"`: follows the visitor's device.

Any other value is rejected with an error.

## What you get back

**theme** `"light" | "dark" | "system"`

The theme now in use. `setTheme()` returns a promise that resolves with it.

## Follow your own theme switch

```js theme={null}
themeSwitch.addEventListener("change", () => {
  DeskHoot.setTheme(themeSwitch.checked ? "dark" : "light");
});
```

## Related

> [card] [Customize your widget](https://docs.deskhoot.com/widgets/customize.md)
>
> Colours, greeting and where the button sits.

> [card] [Open and close](https://docs.deskhoot.com/sdk/control.md)
>
> Control the chat from your own code.

> [card] [Events](https://docs.deskhoot.com/sdk/events.md)
>
> Run your code when something happens.

> [card] [Methods](https://docs.deskhoot.com/sdk/methods.md)
>
> What `DeskHoot` can do.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.