---
schema_version: "1"
id: 4e47636c7e97a3fe283ef3036dc3c01affaa9117b1b61b56e697b00e9ab0ed2e
title: AgentforceThemeManager
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-manager-android.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-theme-manager-android.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2206d35dc653509bd33e31d65aa8e5d8b74146af07fe7db224b64893b871abd7
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# AgentforceThemeManager

`interface AgentforceThemeManager`

The central theme contract. A theme manager holds a fully resolved theme — both color palettes, typography, shapes, dimensions, shadows, the theme mode, and any icon or display-name overrides — and exposes the values the SDK's UI reads at render time.

All theming types live in the package `com.salesforce.android.agentforcesdk.components.theme`.

You don't implement this interface. Obtain an instance from one of the factory functions below, or let the SDK build one for you from an `AgentforceThemeOverrides` bag.

## Members

| Member           | Signature                                                                 | Description                                                                                                                      |
| ---------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `colors`         | `@Composable fun colors(): AgentforceColorPalette`                        | The palette for the currently rendering theme mode. Call from a composable.                                                      |
| `colors`         | `fun colors(isDarkMode: Boolean): AgentforceColorPalette`                 | The palette for the given dark-mode flag. Call from outside composition. A forced `LIGHT` or `DARK` theme mode ignores the flag. |
| `typography`     | `fun typography(): Typography`                                            | The active text styles.                                                                                                          |
| `shapes`         | `fun shapes(): Shapes`                                                    | The active corner shapes.                                                                                                        |
| `dimensions`     | `fun dimensions(): Dimensions`                                            | The active spacing and sizing values.                                                                                            |
| `shadows`        | `fun shadows(): Shadows`                                                  | The active elevation shadows.                                                                                                    |
| `getIcon`        | `fun getIcon(iconType: AgentforceIconType): AgentforceIcon?`              | The custom icon for a slot, or `null` when the SDK's built-in drawable applies.                                                  |
| `getDisplayName` | `fun getDisplayName(displayNameType: AgentforceDisplayNameType): String?` | The custom string for a slot, or `null` when the SDK's built-in string resource applies. An empty override is treated as unset.  |
| `getThemeMode`   | `fun getThemeMode(): AgentforceThemeMode`                                 | The configured mode, returned as-is without resolving `SYSTEM`.                                                                  |
| `isDarkMode`     | `@Composable fun isDarkMode(): Boolean`                                   | Whether dark colors are actually rendering, resolving `SYSTEM` against the device setting.                                       |

`Typography`, `Shapes`, `Dimensions`, and `Shadows` come from the Salesforce SharedUI design system (`com.salesforce.android.sharedui.theme`). `AgentforceColorPalette` is defined by the SDK.

## Factory functions

| Function                              | Signature                                                           | Description                                                                                                                                              |
| ------------------------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `createDefaultAgentforceThemeManager` | `fun createDefaultAgentforceThemeManager(): AgentforceThemeManager` | The out-of-the-box Agentforce theme. Theme mode is `LIGHT`.                                                                                              |
| `createCustomAgentforceThemeManager`  | see below                                                           | A manager with any subset of overrides. Every parameter left `null` falls back to the corresponding Agentforce default. Theme mode defaults to `SYSTEM`. |

```kotlin
fun createCustomAgentforceThemeManager(
    lightColors: AgentforceColorPalette? = null,
    darkColors: AgentforceColorPalette? = null,
    shapes: Shapes? = null,
    dimensions: Dimensions? = null,
    typography: Typography? = null,
    shadows: Shadows? = null,
    themeMode: AgentforceThemeMode? = null,
    icons: Map<AgentforceIconType, AgentforceIcon>? = null,
    displayNames: Map<AgentforceDisplayNameType, String>? = null
): AgentforceThemeManager
```

## Supplying a theme

Pass your theme to `AgentforceConfiguration.Builder.setTheming(...)` using the sealed `AgentforceTheming` type. A theme manager is only one of the three options, and usually not the one you want.

| Option                                      | When to use                                                                                                       |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `AgentforceTheming.Overrides` (recommended) | Tweak specific tokens and let everything else follow the SDK defaults. Any token you leave out keeps its default. |
| `AgentforceTheming.CustomManager`           | Own the entire theme end-to-end with a fully resolved manager.                                                    |
| `AgentforceTheming.Default`                 | No in-code theme — the SDK default theme is used.                                                                 |

```kotlin
val manager = createCustomAgentforceThemeManager(
    lightColors = myLight,
    darkColors = myDark,
    typography = AgentforceTypography.Default.copyWithFontFamily(brandFont),
    themeMode = AgentforceThemeMode.SYSTEM,
)

val configuration = AgentforceConfiguration.builder(authCredentialProvider)
    .setApplication(application)
    .setSalesforceDomain("https://your-instance.salesforce.com")
    .setTheming(AgentforceTheming.CustomManager(manager))
    .build()
```

A resolved manager carries no "unset" signal — every value is already concrete, so there is no way to say "leave this one alone." Prefer `AgentforceTheming.Overrides` unless you genuinely need to own the whole theme.

## Reading theme values in your own components

The active manager is published through a Compose `CompositionLocal`, so custom components rendered inside the chat can match the theme. If no manager is provided, the local falls back to `createDefaultAgentforceThemeManager()`, which keeps components working in isolation and in tests.

```kotlin
val theme = LocalAgentforceTheme.current
val colors = theme.colors()
val typography = theme.typography()

Text(
    text = "Hello",
    style = typography.bodyFontScale1Regular.copy(color = colors.onSurface1),
)
```

## Migration notes

- `AgentforceThemeCreator` and `DefaultAgentforceTheme` are no longer part of the SDK. Use `createDefaultAgentforceThemeManager()` and `createCustomAgentforceThemeManager(...)` instead.
- `AgentforceConfiguration.Builder.setThemeManager(...)` and `setThemeOverrides(...)` are deprecated in favor of the single `setTheming(...)` entry point.

## See also

- [AgentforceThemeMode](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-theme-mode-android.md) — light, dark, or follow the system.
- [Custom Icons](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-icon-type-android.md) — `AgentforceIconType` and `AgentforceIcon`.
- [Display Names](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-display-name-type-android.md) — `AgentforceDisplayNameType`.
- [AgentforceTypography](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-typography-android.md) — font family and text styles.
- [Color Token Reference](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-color-token-reference-android.md) — every customizable color and its light/dark defaults.
