Light + Default Color | Light + Orange | Dark + Default Color | Dark + Green Theme |
![]() | ![]() | ![]() | ![]() |
ThemeState.Method | Parameter | Return Value | Description |
setThemeMode | ThemeMode | Unit | Sets the display mode, automatically saves and refreshes. ThemeMode.SYSTEM: Follows system appearance.ThemeMode.LIGHT: Forces light mode. ThemeMode.DARK: Forces dark mode. |
Method | Parameter | Return Value | Description |
setPrimaryColor | String | Unit | Sets the primary color using a Hex value (e.g., "#1C66E5"). |
clearPrimaryColor | None | Unit | Resets the primary color to the default blue. |
Property | Type | Description |
currentMode | ThemeMode | Current theme mode. |
currentPrimaryColor | String? | Current primary color (Hex format). |
hasCustomPrimaryColor | Boolean | Indicates if a custom primary color is set. |
isDarkMode | Boolean | Indicates if the current mode is dark mode. |


appConfig.json map directly to the configuration options in AppBuilder. Appearance settings are under the theme section:{"theme": {"mode": "light", // Theme mode: light - Light mode, dark - Dark mode, system - Follow system"primaryColor": "#E65100" // Primary color, hexadecimal color value},"messageList": {"alignment": "two-sided","enableReadReceipt": false,"messageActionList": ["copy","recall","quote","forward","delete"]},"conversationList": {"enableCreateConversation": true,"conversationActionList": ["delete","mute","pin","markUnread"]},"messageInput": {"hideSendButton": false,"attachmentPickerMode": "collapsed"},"search": {"hideSearch": false},"avatar": {"shape": "circular"}}
Parameter | Type | Optional Values | Description |
mode | String | "system", "light", "dark" | Theme mode |
primaryColor | String | Hex color value, e.g., "#0ABF77" | Primary color |

setThemeMode API. Example:val themeState = ThemeState.sharedColumn {Button(onClick = {themeState.setThemeMode(ThemeMode.SYSTEM)}) { Text(text = "Follow System") }Button(onClick = {themeState.setThemeMode(ThemeMode.LIGHT)}) { Text(text = "Light Mode") }Button(onClick = {themeState.setThemeMode(ThemeMode.DARK)}) { Text(text = "Dark Mode") }}
setPrimaryColor API. Just provide a Hex color value, and all TUIKit Compose components will automatically use matching colors from the same palette for UI rendering. No manual color adjustments are needed. Example:Column {var text: String by remember { mutableStateOf("#1C66E5") }fun isValidHexColor(): Boolean {return text.matches(Regex("^#[0-9A-Fa-f]{6}$"))}BasicTextField(value = text,onValueChange = { text = it },modifier = Modifier.fillMaxWidth().padding(16.dp))Button(enabled = isValidHexColor(),onClick = {themeState.setPrimaryColor(text)}) {Text("Apply Primary Color")}}
if themeState.isDarkMode {// Currently in dark mode} else {// Currently in light mode}
themeState.clearPrimaryColor() // Remove custom primary colorthemeState.setThemeMode(ThemeMode.SYSTEM) // Switch to system mode
val config = themeState.currentThemeprint("Mode: ${config.mode}")print("Primary Color: ${config.primaryColor ?: "Default"}")
themeState.setThemeMode(ThemeMode.DARK)themeState.setPrimaryColor("#0ABF77")
Feedback