@cometchat/skills 3.1.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +35 -17
  2. package/bin/install.js +389 -43
  3. package/package.json +17 -8
  4. package/skills/cometchat/SKILL.md +653 -50
  5. package/skills/cometchat-android-v5/SKILL.md +120 -0
  6. package/skills/cometchat-android-v5-components/SKILL.md +430 -0
  7. package/skills/cometchat-android-v5-core/SKILL.md +468 -0
  8. package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
  9. package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
  10. package/skills/cometchat-android-v5-features/SKILL.md +130 -0
  11. package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
  12. package/skills/cometchat-android-v5-production/SKILL.md +94 -0
  13. package/skills/cometchat-android-v5-push/SKILL.md +620 -0
  14. package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
  15. package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
  16. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
  17. package/skills/cometchat-android-v6/SKILL.md +107 -0
  18. package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
  19. package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
  20. package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
  21. package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
  22. package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
  23. package/skills/cometchat-android-v6-core/SKILL.md +354 -0
  24. package/skills/cometchat-android-v6-events/SKILL.md +212 -0
  25. package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
  26. package/skills/cometchat-android-v6-features/SKILL.md +130 -0
  27. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
  28. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
  29. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
  30. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
  31. package/skills/cometchat-android-v6-production/SKILL.md +187 -0
  32. package/skills/cometchat-android-v6-push/SKILL.md +274 -0
  33. package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
  34. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
  35. package/skills/cometchat-angular-components/SKILL.md +706 -0
  36. package/skills/cometchat-angular-core/SKILL.md +444 -0
  37. package/skills/cometchat-angular-customization/SKILL.md +424 -0
  38. package/skills/cometchat-angular-features/SKILL.md +447 -0
  39. package/skills/cometchat-angular-patterns/SKILL.md +447 -0
  40. package/skills/cometchat-angular-placement/SKILL.md +685 -0
  41. package/skills/cometchat-angular-production/SKILL.md +415 -0
  42. package/skills/cometchat-angular-theming/SKILL.md +365 -0
  43. package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
  44. package/skills/cometchat-astro-patterns/SKILL.md +3 -3
  45. package/skills/cometchat-components/SKILL.md +2 -0
  46. package/skills/cometchat-core/SKILL.md +11 -6
  47. package/skills/cometchat-customization/references/component-catalog.md +1 -1
  48. package/skills/cometchat-features/SKILL.md +176 -108
  49. package/skills/cometchat-flutter-v5/SKILL.md +167 -0
  50. package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
  51. package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
  52. package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
  53. package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
  54. package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
  55. package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
  56. package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
  57. package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
  58. package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
  59. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
  60. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
  61. package/skills/cometchat-flutter-v6/SKILL.md +445 -0
  62. package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
  63. package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
  64. package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
  65. package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
  66. package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
  67. package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
  68. package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
  69. package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
  70. package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
  71. package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
  72. package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
  73. package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
  74. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
  75. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
  76. package/skills/cometchat-ios/SKILL.md +323 -0
  77. package/skills/cometchat-ios-components/SKILL.md +651 -0
  78. package/skills/cometchat-ios-core/SKILL.md +822 -0
  79. package/skills/cometchat-ios-customization/SKILL.md +825 -0
  80. package/skills/cometchat-ios-features/SKILL.md +725 -0
  81. package/skills/cometchat-ios-placement/SKILL.md +750 -0
  82. package/skills/cometchat-ios-production/SKILL.md +730 -0
  83. package/skills/cometchat-ios-push/SKILL.md +582 -0
  84. package/skills/cometchat-ios-theming/SKILL.md +631 -0
  85. package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
  86. package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
  87. package/skills/cometchat-native-components/SKILL.md +594 -0
  88. package/skills/cometchat-native-core/SKILL.md +407 -0
  89. package/skills/cometchat-native-customization/SKILL.md +594 -0
  90. package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
  91. package/skills/cometchat-native-features/SKILL.md +608 -0
  92. package/skills/cometchat-native-placement/SKILL.md +500 -0
  93. package/skills/cometchat-native-production/SKILL.md +694 -0
  94. package/skills/cometchat-native-push/SKILL.md +593 -0
  95. package/skills/cometchat-native-testing/SKILL.md +583 -0
  96. package/skills/cometchat-native-theming/SKILL.md +656 -0
  97. package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
  98. package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
  99. package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
@@ -0,0 +1,631 @@
1
+ ---
2
+ name: cometchat-ios-theming
3
+ description: "Customize the look and feel of CometChat iOS UI Kit — colors, fonts, styles, and dark mode support."
4
+ license: "MIT"
5
+ compatibility: "CometChatUIKitSwift ^5; iOS 13+"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "chat cometchat ios theming colors fonts styles dark-mode"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ This skill teaches how to customize the visual appearance of CometChat iOS UI Kit components. It covers global theming, component-level styling, dark mode support, and creating custom themes.
16
+
17
+ ---
18
+
19
+ ## 1. Global Theme Configuration
20
+
21
+ CometChat iOS UI Kit uses `CometChatTheme` for global styling. Configure it early in your app lifecycle, before showing any CometChat UI.
22
+
23
+ ### Primary Colors
24
+
25
+ ```swift
26
+ import CometChatUIKitSwift
27
+
28
+ // Set primary brand color
29
+ CometChatTheme.primaryColor = UIColor.systemBlue
30
+
31
+ // Set extended palette (50-900 scale)
32
+ CometChatTheme.extendedPrimaryColor50 = UIColor.systemBlue.withAlphaComponent(0.05)
33
+ CometChatTheme.extendedPrimaryColor100 = UIColor.systemBlue.withAlphaComponent(0.1)
34
+ CometChatTheme.extendedPrimaryColor200 = UIColor.systemBlue.withAlphaComponent(0.2)
35
+ CometChatTheme.extendedPrimaryColor300 = UIColor.systemBlue.withAlphaComponent(0.3)
36
+ CometChatTheme.extendedPrimaryColor400 = UIColor.systemBlue.withAlphaComponent(0.4)
37
+ CometChatTheme.extendedPrimaryColor500 = UIColor.systemBlue.withAlphaComponent(0.5)
38
+ CometChatTheme.extendedPrimaryColor600 = UIColor.systemBlue.withAlphaComponent(0.6)
39
+ CometChatTheme.extendedPrimaryColor700 = UIColor.systemBlue.withAlphaComponent(0.7)
40
+ CometChatTheme.extendedPrimaryColor800 = UIColor.systemBlue.withAlphaComponent(0.8)
41
+ CometChatTheme.extendedPrimaryColor900 = UIColor.systemBlue.withAlphaComponent(0.9)
42
+ ```
43
+
44
+ ### Background Colors
45
+
46
+ ```swift
47
+ // Main backgrounds (01 = primary, 02 = secondary, etc.)
48
+ CometChatTheme.backgroundColor01 = UIColor.systemBackground
49
+ CometChatTheme.backgroundColor02 = UIColor.secondarySystemBackground
50
+ CometChatTheme.backgroundColor03 = UIColor.tertiarySystemBackground
51
+ CometChatTheme.backgroundColor04 = UIColor.quaternarySystemFill
52
+ ```
53
+
54
+ ### Text Colors
55
+
56
+ ```swift
57
+ // Text hierarchy
58
+ CometChatTheme.textColorPrimary = UIColor.label
59
+ CometChatTheme.textColorSecondary = UIColor.secondaryLabel
60
+ CometChatTheme.textColorTertiary = UIColor.tertiaryLabel
61
+ CometChatTheme.textColorDisabled = UIColor.placeholderText
62
+ CometChatTheme.textColorWhite = UIColor.white
63
+ CometChatTheme.textColorHighlight = UIColor.systemBlue
64
+ ```
65
+
66
+ ### Icon Colors
67
+
68
+ ```swift
69
+ CometChatTheme.iconColorPrimary = UIColor.label
70
+ CometChatTheme.iconColorSecondary = UIColor.secondaryLabel
71
+ CometChatTheme.iconColorTertiary = UIColor.tertiaryLabel
72
+ CometChatTheme.iconColorWhite = UIColor.white
73
+ CometChatTheme.iconColorHighlight = UIColor.systemBlue
74
+ ```
75
+
76
+ ### Border Colors
77
+
78
+ ```swift
79
+ CometChatTheme.borderColorDefault = UIColor.separator
80
+ CometChatTheme.borderColorLight = UIColor.separator.withAlphaComponent(0.5)
81
+ CometChatTheme.borderColorDark = UIColor.opaqueSeparator
82
+ CometChatTheme.borderColorHighlight = UIColor.systemBlue
83
+ ```
84
+
85
+ ### Status Colors
86
+
87
+ ```swift
88
+ CometChatTheme.successColor = UIColor.systemGreen
89
+ CometChatTheme.warningColor = UIColor.systemOrange
90
+ CometChatTheme.errorColor = UIColor.systemRed
91
+ CometChatTheme.infoColor = UIColor.systemBlue
92
+ ```
93
+
94
+ ### Neutral Colors (50-900 scale)
95
+
96
+ ```swift
97
+ CometChatTheme.neutralColor50 = UIColor.systemGray6
98
+ CometChatTheme.neutralColor100 = UIColor.systemGray5
99
+ CometChatTheme.neutralColor200 = UIColor.systemGray4
100
+ CometChatTheme.neutralColor300 = UIColor.systemGray3
101
+ CometChatTheme.neutralColor400 = UIColor.systemGray2
102
+ CometChatTheme.neutralColor500 = UIColor.systemGray
103
+ CometChatTheme.neutralColor600 = UIColor.darkGray
104
+ CometChatTheme.neutralColor700 = UIColor.gray
105
+ CometChatTheme.neutralColor800 = UIColor.lightGray
106
+ CometChatTheme.neutralColor900 = UIColor.black
107
+ ```
108
+
109
+ ---
110
+
111
+ ## 2. Typography
112
+
113
+ ### Font Configuration
114
+
115
+ ```swift
116
+ import CometChatUIKitSwift
117
+
118
+ // Set custom font family — class func, NOT a settable property
119
+ CometChatTypography.setFont(name: "Avenir")
120
+
121
+ // Or customize individual text styles
122
+ CometChatTypography.Heading1.bold = UIFont.systemFont(ofSize: 28, weight: .bold)
123
+ CometChatTypography.Heading2.bold = UIFont.systemFont(ofSize: 24, weight: .bold)
124
+ CometChatTypography.Heading3.bold = UIFont.systemFont(ofSize: 20, weight: .bold)
125
+ CometChatTypography.Heading4.medium = UIFont.systemFont(ofSize: 18, weight: .medium)
126
+
127
+ CometChatTypography.Body.regular = UIFont.systemFont(ofSize: 16, weight: .regular)
128
+ CometChatTypography.Body.medium = UIFont.systemFont(ofSize: 16, weight: .medium)
129
+ CometChatTypography.Body.bold = UIFont.systemFont(ofSize: 16, weight: .bold)
130
+
131
+ CometChatTypography.Caption1.regular = UIFont.systemFont(ofSize: 14, weight: .regular)
132
+ CometChatTypography.Caption1.medium = UIFont.systemFont(ofSize: 14, weight: .medium)
133
+
134
+ CometChatTypography.Caption2.regular = UIFont.systemFont(ofSize: 12, weight: .regular)
135
+ CometChatTypography.Caption2.medium = UIFont.systemFont(ofSize: 12, weight: .medium)
136
+ ```
137
+
138
+ ### Using Custom Fonts
139
+
140
+ ```swift
141
+ // Register custom fonts in Info.plist first under "Fonts provided by application"
142
+ // Then set them in CometChatTypography
143
+
144
+ CometChatTypography.Heading1.bold = UIFont(name: "CustomFont-Bold", size: 28) ?? .systemFont(ofSize: 28, weight: .bold)
145
+ CometChatTypography.Body.regular = UIFont(name: "CustomFont-Regular", size: 16) ?? .systemFont(ofSize: 16, weight: .regular)
146
+ ```
147
+
148
+ ---
149
+
150
+ ## 3. Spacing
151
+
152
+ CometChat uses nested classes for spacing configuration.
153
+
154
+ ### Spacing Configuration
155
+
156
+ ```swift
157
+ import CometChatUIKitSwift
158
+
159
+ // Configure spacing scale (s = base, s1-s20 = increments)
160
+ CometChatSpacing.Spacing.s = 2 // Base spacing
161
+ CometChatSpacing.Spacing.s1 = 4
162
+ CometChatSpacing.Spacing.s2 = 8
163
+ CometChatSpacing.Spacing.s3 = 12
164
+ CometChatSpacing.Spacing.s4 = 16
165
+ CometChatSpacing.Spacing.s5 = 20
166
+ CometChatSpacing.Spacing.s6 = 24
167
+ CometChatSpacing.Spacing.s7 = 28
168
+ CometChatSpacing.Spacing.s8 = 32
169
+ CometChatSpacing.Spacing.s9 = 36
170
+ CometChatSpacing.Spacing.s10 = 40
171
+
172
+ // Padding (p = base, p1-p10 = increments)
173
+ CometChatSpacing.Padding.p = 2
174
+ CometChatSpacing.Padding.p1 = 4
175
+ CometChatSpacing.Padding.p2 = 8
176
+ CometChatSpacing.Padding.p3 = 12
177
+ CometChatSpacing.Padding.p4 = 16
178
+ CometChatSpacing.Padding.p5 = 20
179
+ CometChatSpacing.Padding.p6 = 24
180
+
181
+ // Radius (r = base, r1-r6 = increments, rMax = fully rounded)
182
+ CometChatSpacing.Radius.r = 2
183
+ CometChatSpacing.Radius.r1 = 4
184
+ CometChatSpacing.Radius.r2 = 8
185
+ CometChatSpacing.Radius.r3 = 12
186
+ CometChatSpacing.Radius.r4 = 16
187
+ CometChatSpacing.Radius.r5 = 20
188
+ CometChatSpacing.Radius.r6 = 24
189
+ CometChatSpacing.Radius.rMax = 1000 // Fully rounded
190
+
191
+ // Margin (m = base, m1-m20 = increments)
192
+ CometChatSpacing.Margin.m = 2
193
+ CometChatSpacing.Margin.m1 = 4
194
+ CometChatSpacing.Margin.m2 = 8
195
+ CometChatSpacing.Margin.m3 = 12
196
+ CometChatSpacing.Margin.m4 = 16
197
+ ```
198
+
199
+ ### Using Spacing Values
200
+
201
+ ```swift
202
+ // Use spacing values in your layouts
203
+ let padding = CometChatSpacing.Padding.p3 // 12 points
204
+ let cornerRadius = CometChatSpacing.Radius.r2 // 8 points
205
+
206
+ // Use in CometChatCornerStyle
207
+ let style = CometChatCornerStyle(cornerRadius: CometChatSpacing.Radius.r2)
208
+ ```
209
+
210
+ ---
211
+
212
+ ## 4. Component-Level Styling
213
+
214
+ Each CometChat component has a static `style` property. Modify these to customize appearance globally.
215
+
216
+ ### CometChatConversations Style
217
+
218
+ ```swift
219
+ // ConversationsStyle properties
220
+ CometChatConversations.style.backgroundColor = .systemBackground
221
+ CometChatConversations.style.borderWidth = 0
222
+ CometChatConversations.style.borderColor = .clear
223
+ CometChatConversations.style.cornerRadius = CometChatCornerStyle(cornerRadius: 0)
224
+
225
+ // Title styling
226
+ CometChatConversations.style.titleFont = CometChatTypography.Heading4.medium
227
+ CometChatConversations.style.titleColor = CometChatTheme.textColorPrimary
228
+ CometChatConversations.style.largeTitleFont = CometChatTypography.Heading1.bold
229
+ CometChatConversations.style.largeTitleColor = CometChatTheme.textColorPrimary
230
+
231
+ // List item styling
232
+ CometChatConversations.style.listItemTitleTextColor = CometChatTheme.textColorPrimary
233
+ CometChatConversations.style.listItemTitleFont = CometChatTypography.Heading4.medium
234
+ CometChatConversations.style.listItemSubTitleTextColor = CometChatTheme.textColorSecondary
235
+ CometChatConversations.style.listItemSubTitleFont = CometChatTypography.Body.regular
236
+ CometChatConversations.style.listItemBackground = .clear
237
+ CometChatConversations.style.listItemSelectedBackground = CometChatTheme.backgroundColor04
238
+
239
+ // Empty state styling
240
+ CometChatConversations.style.emptyTitleTextFont = CometChatTypography.Heading3.bold
241
+ CometChatConversations.style.emptyTitleTextColor = CometChatTheme.textColorPrimary
242
+ CometChatConversations.style.emptySubTitleFont = CometChatTypography.Body.regular
243
+ CometChatConversations.style.emptySubTitleTextColor = CometChatTheme.textColorSecondary
244
+
245
+ // Error state styling
246
+ CometChatConversations.style.errorTitleTextFont = CometChatTypography.Heading3.bold
247
+ CometChatConversations.style.errorTitleTextColor = CometChatTheme.textColorPrimary
248
+ CometChatConversations.style.errorSubTitleFont = CometChatTypography.Body.regular
249
+ CometChatConversations.style.errorSubTitleTextColor = CometChatTheme.textColorSecondary
250
+
251
+ // Retry button styling
252
+ CometChatConversations.style.retryButtonTextColor = CometChatTheme.buttonTextColor
253
+ CometChatConversations.style.retryButtonTextFont = CometChatTypography.Button.medium
254
+ CometChatConversations.style.retryButtonBackgroundColor = CometChatTheme.primaryColor
255
+
256
+ // Group type icons
257
+ CometChatConversations.style.privateGroupImageTintColor = CometChatTheme.backgroundColor01
258
+ CometChatConversations.style.privateGroupImageBackgroundColor = CometChatTheme.successColor
259
+ CometChatConversations.style.passwordGroupImageTintColor = CometChatTheme.backgroundColor01
260
+ CometChatConversations.style.passwordGroupImageBackgroundColor = CometChatTheme.warningColor
261
+
262
+ // Message type icon
263
+ CometChatConversations.style.messageTypeImageTint = CometChatTheme.iconColorSecondary
264
+ ```
265
+
266
+ ### CometChatMessageList Style
267
+
268
+ ```swift
269
+ // MessageListStyle properties
270
+ CometChatMessageList.style.backgroundColor = CometChatTheme.backgroundColor02
271
+ CometChatMessageList.style.borderWidth = 0
272
+ CometChatMessageList.style.borderColor = .clear
273
+
274
+ // Shimmer loading colors
275
+ CometChatMessageList.style.shimmerGradientColor1 = CometChatTheme.backgroundColor04
276
+ CometChatMessageList.style.shimmerGradientColor2 = CometChatTheme.backgroundColor03
277
+
278
+ // Empty state styling
279
+ CometChatMessageList.style.emptyStateTitleColor = CometChatTheme.textColorPrimary
280
+ CometChatMessageList.style.emptyStateTitleFont = CometChatTypography.Heading3.bold
281
+ CometChatMessageList.style.emptyStateSubtitleColor = CometChatTheme.textColorSecondary
282
+ CometChatMessageList.style.emptyStateSubtitleFont = CometChatTypography.Body.regular
283
+
284
+ // Error state styling
285
+ CometChatMessageList.style.errorStateTitleColor = CometChatTheme.textColorPrimary
286
+ CometChatMessageList.style.errorStateTitleFont = CometChatTypography.Heading3.bold
287
+ CometChatMessageList.style.errorStateSubtitleColor = CometChatTheme.textColorSecondary
288
+ CometChatMessageList.style.errorStateSubtitleFont = CometChatTypography.Body.regular
289
+
290
+ // New message indicator
291
+ CometChatMessageList.style.newMessageIndicatorTextColor = CometChatTheme.errorColor
292
+ CometChatMessageList.style.newMessageIndicatorBackgroundColor = CometChatTheme.errorColor
293
+ CometChatMessageList.style.newMessageIndicatorTextFont = CometChatTypography.Caption1.medium
294
+
295
+ // Background image (optional)
296
+ CometChatMessageList.style.backgroundImage = UIImage(named: "chat-background")
297
+ ```
298
+
299
+ ### CometChatMessageBubble Style
300
+
301
+ Message bubbles use separate styles for incoming and outgoing messages:
302
+
303
+ ```swift
304
+ // OUTGOING message bubble (sent by current user)
305
+ CometChatMessageBubble.style.outgoing.backgroundColor = CometChatTheme.primaryColor
306
+ CometChatMessageBubble.style.outgoing.borderWidth = 0
307
+ CometChatMessageBubble.style.outgoing.borderColor = .clear
308
+ CometChatMessageBubble.style.outgoing.cornerRadius = CometChatCornerStyle(cornerRadius: 16)
309
+ CometChatMessageBubble.style.outgoing.headerTextColor = CometChatTheme.primaryColor
310
+ CometChatMessageBubble.style.outgoing.headerTextFont = CometChatTypography.Caption1.medium
311
+
312
+ // INCOMING message bubble (received from others)
313
+ CometChatMessageBubble.style.incoming.backgroundColor = CometChatTheme.neutralColor300
314
+ CometChatMessageBubble.style.incoming.borderWidth = 0
315
+ CometChatMessageBubble.style.incoming.borderColor = .clear
316
+ CometChatMessageBubble.style.incoming.cornerRadius = CometChatCornerStyle(cornerRadius: 16)
317
+ CometChatMessageBubble.style.incoming.headerTextColor = CometChatTheme.primaryColor
318
+ CometChatMessageBubble.style.incoming.headerTextFont = CometChatTypography.Caption1.medium
319
+
320
+ // Text bubble styling within message bubbles
321
+ CometChatMessageBubble.style.outgoing.textBubbleStyle.textColor = .white
322
+ CometChatMessageBubble.style.outgoing.textBubbleStyle.textFont = CometChatTypography.Body.regular
323
+
324
+ CometChatMessageBubble.style.incoming.textBubbleStyle.textColor = CometChatTheme.textColorPrimary
325
+ CometChatMessageBubble.style.incoming.textBubbleStyle.textFont = CometChatTypography.Body.regular
326
+ ```
327
+
328
+ ### CometChatMessageComposer Style
329
+
330
+ ```swift
331
+ // MessageComposerStyle properties
332
+ CometChatMessageComposer.style.backgroundColor = CometChatTheme.backgroundColor03
333
+ CometChatMessageComposer.style.borderWidth = 0
334
+ CometChatMessageComposer.style.borderColor = .clear
335
+
336
+ // Text input styling
337
+ CometChatMessageComposer.style.placeHolderTextFont = CometChatTypography.Body.regular
338
+ CometChatMessageComposer.style.placeHolderTextColor = CometChatTheme.textColorTertiary
339
+ CometChatMessageComposer.style.textFiledColor = CometChatTheme.textColorPrimary
340
+ CometChatMessageComposer.style.textFiledFont = CometChatTypography.Body.regular
341
+
342
+ // Compose box styling
343
+ CometChatMessageComposer.style.composeBoxBackgroundColor = CometChatTheme.backgroundColor01
344
+ CometChatMessageComposer.style.composeBoxBorderColor = CometChatTheme.borderColorDefault
345
+ CometChatMessageComposer.style.composeBoxBorderWidth = 1
346
+ CometChatMessageComposer.style.composerBoxCornerRadius = CometChatCornerStyle(cornerRadius: CometChatSpacing.Radius.r2)
347
+ CometChatMessageComposer.style.composerSeparatorColor = CometChatTheme.borderColorLight
348
+
349
+ // Send button styling
350
+ CometChatMessageComposer.style.sendButtonImageTint = CometChatTheme.white
351
+ CometChatMessageComposer.style.activeSendButtonImageBackgroundColor = CometChatTheme.primaryColor
352
+ CometChatMessageComposer.style.inactiveSendButtonImageBackgroundColor = CometChatTheme.neutralColor300
353
+
354
+ // Attachment button styling
355
+ CometChatMessageComposer.style.attachmentImageTint = CometChatTheme.iconColorSecondary
356
+
357
+ // Voice recording button styling
358
+ CometChatMessageComposer.style.voiceRecordingImageTint = CometChatTheme.iconColorSecondary
359
+
360
+ // AI button styling
361
+ CometChatMessageComposer.style.aiImageTint = CometChatTheme.iconColorSecondary
362
+
363
+ // Sticker button styling
364
+ CometChatMessageComposer.style.stickerTint = CometChatTheme.iconColorSecondary
365
+
366
+ // Edit preview styling
367
+ CometChatMessageComposer.style.editPreviewTitleTextFont = CometChatTypography.Body.regular
368
+ CometChatMessageComposer.style.editPreviewTitleTextColor = CometChatTheme.textColorPrimary
369
+ CometChatMessageComposer.style.editPreviewMessageTextFont = CometChatTypography.Caption1.regular
370
+ CometChatMessageComposer.style.editPreviewMessageTextColor = CometChatTheme.textColorSecondary
371
+ CometChatMessageComposer.style.editPreviewBackgroundColor = CometChatTheme.backgroundColor03
372
+ CometChatMessageComposer.style.editPreviewBorderColor = CometChatTheme.borderColorHighlight
373
+ CometChatMessageComposer.style.editPreviewCloseIconTint = CometChatTheme.iconColorHighlight
374
+ ```
375
+
376
+ ### CometChatAvatar Style
377
+
378
+ ```swift
379
+ // AvatarStyle properties
380
+ CometChatAvatar.style.backgroundColor = CometChatTheme.extendedPrimaryColor500
381
+ CometChatAvatar.style.textColor = CometChatTheme.white
382
+ CometChatAvatar.style.textFont = CometChatTypography.Heading2.bold
383
+ CometChatAvatar.style.borderColor = .clear
384
+ CometChatAvatar.style.borderWidth = 0
385
+ CometChatAvatar.style.cornerRadius = nil // nil = circle by default
386
+ ```
387
+
388
+ ### CometChatBadge Style
389
+
390
+ ```swift
391
+ // BadgeStyle properties
392
+ CometChatBadge.style.backgroundColor = CometChatTheme.primaryColor
393
+ CometChatBadge.style.textColor = CometChatTheme.buttonIconColor
394
+ CometChatBadge.style.textFont = CometChatTypography.Caption1.regular
395
+ CometChatBadge.style.cornerRadius = nil // nil = pill shape by default
396
+ CometChatBadge.style.borderWidth = 0.5
397
+ CometChatBadge.style.borderColor = UIColor.clear.cgColor
398
+ ```
399
+
400
+ ### CometChatStatusIndicator Style
401
+
402
+ ```swift
403
+ // StatusIndicatorStyle properties
404
+ CometChatStatusIndicator.style.backgroundColor = CometChatTheme.successColor
405
+ CometChatStatusIndicator.style.borderColor = CometChatTheme.backgroundColor01
406
+ CometChatStatusIndicator.style.borderWidth = 0
407
+ CometChatStatusIndicator.style.cornerRadius = nil // nil = circle by default
408
+ CometChatStatusIndicator.style.backgroundImage = nil
409
+ ```
410
+
411
+ ### CometChatDate Style
412
+
413
+ ```swift
414
+ // DateStyle properties
415
+ CometChatDate.style.textColor = CometChatTheme.textColorPrimary
416
+ CometChatDate.style.textFont = CometChatTypography.Caption1.medium
417
+ CometChatDate.style.backgroundColor = CometChatTheme.backgroundColor02
418
+ CometChatDate.style.borderWidth = 1
419
+ CometChatDate.style.borderColor = CometChatTheme.borderColorDark
420
+ CometChatDate.style.cornerRadius = nil
421
+ ```
422
+
423
+ ### CometChatReceipt Style
424
+
425
+ ```swift
426
+ // ReceiptStyle properties
427
+ CometChatReceipt.style.waitImageTintColor = CometChatTheme.iconColorSecondary
428
+ CometChatReceipt.style.sentImageTintColor = CometChatTheme.iconColorSecondary
429
+ CometChatReceipt.style.deliveredImageTintColor = CometChatTheme.iconColorSecondary
430
+ CometChatReceipt.style.readImageTintColor = CometChatTheme.messageReadColor
431
+ CometChatReceipt.style.errorImageTintColor = CometChatTheme.iconColorSecondary
432
+
433
+ // Custom receipt images (optional)
434
+ CometChatReceipt.style.waitImage = UIImage(systemName: "clock")?.withRenderingMode(.alwaysTemplate) ?? UIImage()
435
+ CometChatReceipt.style.sentImage = UIImage(systemName: "checkmark")?.withRenderingMode(.alwaysTemplate) ?? UIImage()
436
+ CometChatReceipt.style.deliveredImage = UIImage(systemName: "checkmark.circle")?.withRenderingMode(.alwaysTemplate) ?? UIImage()
437
+ CometChatReceipt.style.readImage = UIImage(systemName: "checkmark.circle.fill")?.withRenderingMode(.alwaysTemplate) ?? UIImage()
438
+ ```
439
+
440
+ ---
441
+
442
+ ## 5. Dark Mode Support
443
+
444
+ CometChat automatically supports dark mode when using system colors. For custom colors, use dynamic colors:
445
+
446
+ ### Using Dynamic Colors
447
+
448
+ ```swift
449
+ // Create a dynamic color that adapts to light/dark mode
450
+ let dynamicPrimary = UIColor { traitCollection in
451
+ switch traitCollection.userInterfaceStyle {
452
+ case .dark:
453
+ return UIColor(red: 0.4, green: 0.6, blue: 1.0, alpha: 1.0)
454
+ default:
455
+ return UIColor(red: 0.0, green: 0.4, blue: 0.8, alpha: 1.0)
456
+ }
457
+ }
458
+
459
+ CometChatTheme.primaryColor = dynamicPrimary
460
+ ```
461
+
462
+ ### Using Asset Catalog Colors
463
+
464
+ 1. Create a Color Set in your asset catalog
465
+ 2. Configure appearances for Any, Light, and Dark
466
+ 3. Reference in code:
467
+
468
+ ```swift
469
+ CometChatTheme.primaryColor = UIColor(named: "BrandPrimary") ?? .systemBlue
470
+ CometChatTheme.backgroundColor01 = UIColor(named: "Background") ?? .systemBackground
471
+ ```
472
+
473
+ ### Complete Theme Configuration Function
474
+
475
+ ```swift
476
+ func configureCometChatTheme() {
477
+ // Primary color with dark mode support
478
+ CometChatTheme.primaryColor = UIColor { trait in
479
+ trait.userInterfaceStyle == .dark
480
+ ? UIColor(red: 0.35, green: 0.55, blue: 0.93, alpha: 1.0)
481
+ : UIColor(red: 0.2, green: 0.4, blue: 0.8, alpha: 1.0)
482
+ }
483
+
484
+ // Backgrounds
485
+ CometChatTheme.backgroundColor01 = UIColor { trait in
486
+ trait.userInterfaceStyle == .dark
487
+ ? UIColor(red: 0.11, green: 0.11, blue: 0.12, alpha: 1.0)
488
+ : UIColor.white
489
+ }
490
+
491
+ CometChatTheme.backgroundColor02 = UIColor { trait in
492
+ trait.userInterfaceStyle == .dark
493
+ ? UIColor(red: 0.17, green: 0.17, blue: 0.18, alpha: 1.0)
494
+ : UIColor(red: 0.95, green: 0.95, blue: 0.97, alpha: 1.0)
495
+ }
496
+
497
+ // Text colors
498
+ CometChatTheme.textColorPrimary = UIColor { trait in
499
+ trait.userInterfaceStyle == .dark
500
+ ? UIColor.white
501
+ : UIColor.black
502
+ }
503
+
504
+ CometChatTheme.textColorSecondary = UIColor { trait in
505
+ trait.userInterfaceStyle == .dark
506
+ ? UIColor(red: 0.56, green: 0.56, blue: 0.58, alpha: 1.0)
507
+ : UIColor(red: 0.42, green: 0.42, blue: 0.45, alpha: 1.0)
508
+ }
509
+ }
510
+ ```
511
+
512
+ ---
513
+
514
+ ## 6. Preset Theme Examples
515
+
516
+ ### WhatsApp-like Theme
517
+
518
+ ```swift
519
+ func applyWhatsAppTheme() {
520
+ // Primary green
521
+ CometChatTheme.primaryColor = UIColor(red: 0.15, green: 0.83, blue: 0.4, alpha: 1.0)
522
+
523
+ // Backgrounds
524
+ CometChatTheme.backgroundColor01 = UIColor { trait in
525
+ trait.userInterfaceStyle == .dark
526
+ ? UIColor(red: 0.07, green: 0.11, blue: 0.13, alpha: 1.0)
527
+ : UIColor.white
528
+ }
529
+
530
+ CometChatTheme.backgroundColor02 = UIColor { trait in
531
+ trait.userInterfaceStyle == .dark
532
+ ? UIColor(red: 0.12, green: 0.17, blue: 0.2, alpha: 1.0)
533
+ : UIColor(red: 0.94, green: 0.95, blue: 0.96, alpha: 1.0)
534
+ }
535
+
536
+ // Outgoing message bubble (green)
537
+ CometChatMessageBubble.style.outgoing.backgroundColor = UIColor { trait in
538
+ trait.userInterfaceStyle == .dark
539
+ ? UIColor(red: 0.0, green: 0.36, blue: 0.29, alpha: 1.0)
540
+ : UIColor(red: 0.86, green: 0.97, blue: 0.78, alpha: 1.0)
541
+ }
542
+
543
+ CometChatMessageBubble.style.outgoing.textBubbleStyle.textColor = UIColor { trait in
544
+ trait.userInterfaceStyle == .dark ? .white : .black
545
+ }
546
+
547
+ // Incoming message bubble
548
+ CometChatMessageBubble.style.incoming.backgroundColor = UIColor { trait in
549
+ trait.userInterfaceStyle == .dark
550
+ ? UIColor(red: 0.12, green: 0.17, blue: 0.2, alpha: 1.0)
551
+ : UIColor.white
552
+ }
553
+ }
554
+ ```
555
+
556
+ ### iMessage-like Theme
557
+
558
+ ```swift
559
+ func applyiMessageTheme() {
560
+ // Blue primary
561
+ CometChatTheme.primaryColor = UIColor(red: 0.0, green: 0.48, blue: 1.0, alpha: 1.0)
562
+
563
+ // Outgoing message bubble (blue)
564
+ CometChatMessageBubble.style.outgoing.backgroundColor = UIColor(red: 0.0, green: 0.48, blue: 1.0, alpha: 1.0)
565
+ CometChatMessageBubble.style.outgoing.textBubbleStyle.textColor = .white
566
+ CometChatMessageBubble.style.outgoing.cornerRadius = CometChatCornerStyle(cornerRadius: 18)
567
+
568
+ // Incoming message bubble (gray)
569
+ CometChatMessageBubble.style.incoming.backgroundColor = UIColor { trait in
570
+ trait.userInterfaceStyle == .dark
571
+ ? UIColor(red: 0.23, green: 0.23, blue: 0.24, alpha: 1.0)
572
+ : UIColor(red: 0.91, green: 0.91, blue: 0.92, alpha: 1.0)
573
+ }
574
+ CometChatMessageBubble.style.incoming.textBubbleStyle.textColor = UIColor { trait in
575
+ trait.userInterfaceStyle == .dark ? .white : .black
576
+ }
577
+ CometChatMessageBubble.style.incoming.cornerRadius = CometChatCornerStyle(cornerRadius: 18)
578
+ }
579
+ ```
580
+
581
+ ---
582
+
583
+ ## 7. Instance-Level Styling
584
+
585
+ For styling specific instances without affecting global styles:
586
+
587
+ ```swift
588
+ // Create a conversations list with custom style
589
+ let conversations = CometChatConversations()
590
+
591
+ // Override style for this instance only
592
+ conversations.style.backgroundColor = UIColor.systemPink.withAlphaComponent(0.1)
593
+ conversations.style.listItemTitleTextColor = .systemPink
594
+
595
+ // Avatar style for this instance
596
+ conversations.avatarStyle.backgroundColor = UIColor.systemPink.withAlphaComponent(0.2)
597
+ ```
598
+
599
+ ---
600
+
601
+ ## 8. Helper Extension
602
+
603
+ ```swift
604
+ extension UIColor {
605
+ convenience init(hex: String) {
606
+ var hexSanitized = hex.trimmingCharacters(in: .whitespacesAndNewlines)
607
+ hexSanitized = hexSanitized.replacingOccurrences(of: "#", with: "")
608
+
609
+ var rgb: UInt64 = 0
610
+ Scanner(string: hexSanitized).scanHexInt64(&rgb)
611
+
612
+ let r = CGFloat((rgb & 0xFF0000) >> 16) / 255.0
613
+ let g = CGFloat((rgb & 0x00FF00) >> 8) / 255.0
614
+ let b = CGFloat(rgb & 0x0000FF) / 255.0
615
+
616
+ self.init(red: r, green: g, blue: b, alpha: 1.0)
617
+ }
618
+ }
619
+ ```
620
+
621
+ ---
622
+
623
+ ## Best Practices
624
+
625
+ 1. **Configure theme early** — Set theme in `application(_:didFinishLaunchingWithOptions:)` before any CometChat UI is shown
626
+ 2. **Use system colors** — They automatically adapt to dark mode
627
+ 3. **Test both modes** — Always verify appearance in light and dark mode
628
+ 4. **Use dynamic colors** — For custom colors that need to adapt to appearance changes
629
+ 5. **Maintain contrast** — Ensure text is readable against backgrounds (WCAG guidelines)
630
+ 6. **Be consistent** — Use the same color palette throughout your app
631
+ 7. **Consider accessibility** — Support Dynamic Type by not hardcoding font sizes where possible