The UI Kit supports two approaches to styling: XML theme attributes for declarative, app-wide theming, and programmatic setters for runtime customization.
Programmatic setters take precedence over XML theme attributes when both are applied to the same property.
XML Theme Hierarchy
The theming system follows a three-level hierarchy:
- Your
AppTheme extends CometChatTheme.DayNight (theme-level colors and fonts)
- Component styles extend parent styles (e.g.,
cometchatConversationsStyle)
- Sub-component styles are nested within component styles (e.g., avatar style within conversations)
Font Customization
Override fonts at the theme level using these attributes:
Programmatic Styling with CometChatTheme
The CometChatTheme class provides static setter/getter methods for runtime color and typography token overrides:
Color Tokens
Icon Tints
Component Style Setters
Each component exposes setter methods for its own style and sub-component styles. Using CometChatConversations as an example: