Branding and Theming

The Agentforce iOS SDK provides comprehensive theming capabilities for customizing the visual appearance of chat interfaces and UI components.

The Agentforce iOS SDK includes a sophisticated theming system built on top of Salesforce's design system. The theming system provides:

  • Color Theming: Complete color palette customization with semantic tokens
  • Light/Dark Mode Support: Automatic switching and explicit mode setting
  • System Integration: Adapts to iOS appearance preferences
  • Reactive Updates: Observable state management for real-time theme changes
  • AgentforceThemeManager: Central theme management interface
  • AgentforceDefaultThemeManager: Default implementation with Agentforce Cosmos design tokens
  • AgentforceThemeMode: Configuration for theme modes (light, dark, system)
  • AgentforceColors: Protocol for color palettes with semantic color tokens

The theming system provides comprehensive color tokens organized by purpose:

  • surface1: Primary view background
  • surface2: Secondary view background
  • surfaceContainer1: Default container background (cards, modals)
  • surfaceContainer2: Darker container background
  • surfaceContainer3: Darkest container background
  • onSurface1: Lightest text/icon fill (body text, labels)
  • onSurface2: Darker text/icon fill (headings, input fields)
  • onSurface3: Additional text/icon variant
  • accent1: Button icons and interactive elements
  • accent2: Links, hover states, primary actions
  • accent3: Selected states
  • accentContainer1: Branded button backgrounds
  • onAccent1: Text/icons on accent containers
  • error1: Error text and icons
  • errorContainer1: Error alert backgrounds
  • onError1: Text on error containers
  • borderError1: Error button borders
  • successContainer1: Success alert backgrounds
  • onSuccess1: Success text and icons
  • borderSuccess1: Success button borders
  • disabledContainer1: Disabled white component backgrounds
  • disabledContainer2: Disabled dark component backgrounds
  • onDisabled1: Text on light disabled containers
  • onDisabled2: Text on dark disabled containers
  • brandBase50: Primary brand color
  • errorBase50: Error brand color
  • feedbackWarning1: Warning text color
  • feedbackWarningContainer1: Warning container background
  • info1: Information text color
  • infoContainer1: Information container background

The following sections show how to implement theming in your iOS application.

Currently, only color theming is supported. Fonts, dimensions, and shapes are not yet implemented in the theming system.

The following best practices ensure effective theming implementation.

  1. Use Semantic Colors: Always use semantic color tokens rather than hardcoded colors
  2. Test Both Modes: Ensure your custom colors work well in both light and dark modes
  3. System Integration: Use .system mode to respect user preferences
  4. Inheritance: Extend base color classes rather than implementing from scratch
  5. Accessibility: Ensure sufficient color contrast for accessibility compliance
  • UI Components: See iOS UI Components for component theming
  • Configuration: See AgentforceConfiguration for setup
  • Integration: See iOS Development for architecture patterns