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.

MemberSignatureDescription
colors@Composable fun colors(): AgentforceColorPaletteThe palette for the currently rendering theme mode. Call from a composable.
colorsfun colors(isDarkMode: Boolean): AgentforceColorPaletteThe palette for the given dark-mode flag. Call from outside composition. A forced LIGHT or DARK theme mode ignores the flag.
typographyfun typography(): TypographyThe active text styles.
shapesfun shapes(): ShapesThe active corner shapes.
dimensionsfun dimensions(): DimensionsThe active spacing and sizing values.
shadowsfun shadows(): ShadowsThe active elevation shadows.
getIconfun getIcon(iconType: AgentforceIconType): AgentforceIcon?The custom icon for a slot, or null when the SDK’s built-in drawable applies.
getDisplayNamefun 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.
getThemeModefun getThemeMode(): AgentforceThemeModeThe configured mode, returned as-is without resolving SYSTEM.
isDarkMode@Composable fun isDarkMode(): BooleanWhether 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.

FunctionSignatureDescription
createDefaultAgentforceThemeManagerfun createDefaultAgentforceThemeManager(): AgentforceThemeManagerThe out-of-the-box Agentforce theme. Theme mode is LIGHT.
createCustomAgentforceThemeManagersee belowA manager with any subset of overrides. Every parameter left null falls back to the corresponding Agentforce default. Theme mode defaults to SYSTEM.

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.

OptionWhen 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.CustomManagerOwn the entire theme end-to-end with a fully resolved manager.
AgentforceTheming.DefaultNo in-code theme — the SDK default theme is used.

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.

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.

For help replacing removed theme configuration and initialization APIs, see Theming Migration.