---
schema_version: "1"
id: ec281bed7d72a24f6f75698ea799b5c331f90f055405b55b76a13989a70d2edc
title: Theme Mode
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/android/agentforce-theme-mode-android.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-theme-mode-android.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5eed0716675a07c68576b8381e968e00cd0f6fb104c24cee932a1f2fbc25fc3c
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# Theme Mode

`enum class AgentforceThemeMode`

Controls whether the SDK renders its light palette, its dark palette, or follows the device's system setting.

Declared in package `com.salesforce.android.agentforcesdk.components.theme`.

## Members

| Member   | Description                                                                                |
| -------- | ------------------------------------------------------------------------------------------ |
| `SYSTEM` | Follow the device's light/dark setting. Recomposes automatically when the setting changes. |
| `LIGHT`  | Always render the light palette, regardless of the device setting.                         |
| `DARK`   | Always render the dark palette, regardless of the device setting.                          |

## Setting the mode

Set `themeMode` on `AgentforceThemeOverrides` or pass it to `createCustomAgentforceThemeManager(...)`:

```kotlin
import com.salesforce.android.agentforcesdk.components.theme.AgentforceThemeMode
import com.salesforce.android.agentforcesdk.components.theme.AgentforceThemeOverrides

val overrides = AgentforceThemeOverrides(
    themeMode = AgentforceThemeMode.SYSTEM, // or LIGHT / DARK
)
```

If you don't set `themeMode`, `createDefaultAgentforceThemeManager()` uses `LIGHT` and `createCustomAgentforceThemeManager(...)` defaults to `SYSTEM`.

## Reading the resolved mode

`AgentforceThemeManager.getThemeMode()` returns the configured mode as-is, without resolving `SYSTEM`. To find out which palette is actually rendering — including the resolved value when the mode is `SYSTEM` — call the composable `isDarkMode()` instead:

```kotlin
val theme = LocalAgentforceTheme.current
val isDark = theme.isDarkMode()
```

## Notes

- Theme mode always comes from your app's configuration, falling back to the SDK default.
- Test your theme in both light and dark mode, and check color contrast in each (WCAG AA).

## See also

- [AgentforceThemeManager](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-theme-manager-android.md) — `getThemeMode()` and `isDarkMode()`.
- [AgentforceColors](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-colors-android.md) — the light and dark palettes that theme mode selects between.
