Customizing the UI
The Zendesk SDK UI can be styled to match your brand using Admin Center, which currently allows you to set the primary color, message bubble color, and action button color. However, Admin Center does not support customization of all UI elements—most notably, text colors for buttons, messages, and actions.
To address this limitation, the SDK provides a temporary UserColors
API for developers who need to override text colors directly in their app code. This API lets you specify custom text colors for both light and dark mode, ensuring your UI remains accessible and visually consistent. Note that UserColors
will be deprecated once Admin Center supports full color customization, so plan to migrate your settings when that feature becomes available.
Limitations
Feature | Can be customized in Admin Center? |
---|---|
Primary color (backgrounds, headers, etc.) | Yes |
Message bubble color | Yes |
Action button color | Yes |
Text colors (onPrimary, onMessage, onAction) | No |
Some secondary UI elements | No |
Customizing text colors with UserColors API
To customize text colors, use the UserColors
API when initializing the SDK. This allows you to set text colors for light and dark mode.
Swift
let colors = UserColors(onPrimary: .black,
onMessage: .black,
onAction: .black)
let factory = DefaultMessagingFactory(userLightColors: colors,
userDarkColors: colors)
Zendesk.initialize(withChannelKey: "channel_key",
messagingFactory: factory) { result in
// ...
}
Objective-C
// Set custom text colors for primary, message, and action elements
ZDKUserColors *colors = [[ZDKUserColors alloc] initOnPrimary:UIColor.blackColor
onMessage:UIColor.blackColor
onAction:UIColor.blackColor];
ZDKDefaultMessagingFactory *factory = [[ZDKDefaultMessagingFactory alloc] initWithUserLightColors:colors
userDarkColors:colors];
[Zendesk initializeWithChannelKey:@"channel_key"
messagingFactory:factory
completionHandler:^(Zendesk * _Nullable zendesk, NSError * _Nullable error) {
// ...
}];
FAQ
Q: Can I customize all UI colors in Admin Center?
A: No. Only primary, message bubble, and action button colors are customizable in Admin Center. Text colors and some secondary UI elements must be set using the SDK’s UserColors
API.
Q: What happens if I set text colors in Admin Center?
A: Text colors cannot be overridden in Admin Center. You must use the UserColors
API in your app code to change them.
Q: Is the UserColors
API permanent?
A: No. The UserColors
API is temporary and will be deprecated once Admin Center supports full color customization. Plan to migrate your color settings to Admin Center when available.
Q: How do I support both light and dark mode for text colors?
A: Pass different UserColors
objects for userLightColors
and userDarkColors
when initializing the SDK.
Q: What if I don’t set text colors using UserColors
?
A: The SDK will use its default text colors, which may not match your brand or accessibility requirements.