AI Integration Quick Reference
AI Integration Quick Reference
When to use this
- You want every UI Kit screen to use your brand colour.
- You need light and dark appearance with consistent colours.
- You want to change background, text, stroke or icon colours, or the font, across every component.
Prerequisites
- The UI Kit is installed and you are logged in — see SwiftUI getting started or UIKit getting started.
Core Concepts
Both toolkits read one token table inCometChatCore, so a token is the same colour in
SwiftUI and in UIKit. Only the way you set the theme differs.
- SwiftUI
- UIKit
CometChatTheme is a value carried in the SwiftUI environment.theme.lightandtheme.dark— aCometChatColorSchemeeach, 56 colour tokens. The one matching the environment’scolorSchemeis used.theme.typography—CometChatTypography, 28 font tokens.theme.shapes—CometChatShapes, five corner radii..cometChatTheme(_:)sets it for a view and everything below it, so different parts of an app can use different themes.
style: argument, then the theme, then the Kit default.Quick Start
- SwiftUI
- UIKit
1
Build a theme
2
Apply it at the root
3
Build and verify
Run the app and check the Kit’s screens in both light and dark appearance.

Default

Brand colour

Dark appearance
Change the Primary Color
One brand colour derivesprimary, every token defined as primary, and the ten-step
extendedPrimary ramp — each step mixes the colour toward white (light) or black (dark). The middle screenshot above is that ramp derived from one colour, with nothing
else set.
- SwiftUI
- UIKit

UIKit — default

UIKit — setBrandColor(_:)
Customize Common Theme Tokens
Every token stays individually settable after deriving.- SwiftUI
- UIKit
CometChatColorScheme is a value: a token you set is that colour, whatever it was
derived from.Add Dark Mode Support
Dark appearance is built in: both toolkits ship a dark palette and switch with the system. Override it only where your brand differs.- SwiftUI
- UIKit
theme.dark is used when the environment’s colorScheme is .dark:Apply a Theme to a Specific Screen
- SwiftUI
- UIKit
The theme is scoped to the view you set it on, so a nested
.cometChatTheme(_:) wins
for its subtree:Typography
28 tokens: each level in bold, medium and regular, in the system font.- SwiftUI
- UIKit
Build the whole scale in your font family, or replace one token:
The Kit’s own sizes scale with Dynamic Type on the
UIFontMetrics.default curve, with
no upper limit. Lay out your own views around Kit text so
they hold at the largest accessibility sizes.Shapes
CometChatShapes carries five radii — extraSmall 4, small 8, medium 12, large 16,
extraLarge 28 — as theme.shapes in the SwiftUI toolkit. The UIKit theme has no shape
tokens; corner radii are set per component through its style.
Color Token Reference
The tokens you reach for most. Color Resources lists all 56 with their light and dark values.Contrast
A few of the palette’s pairings sit under WCAG AA: tertiary text and the secondary icon tint (#A1A1A1) on white, the warning self-mention, the error text on
background2. If you need AA throughout, override the tokens involved — for example
textTertiary and iconTintSecondary — and check each pair you create: tertiary text sits on
background3 in the search field, the tightest combination in the Kit.
Next Steps
Color Resources
Every colour token with its light and dark value.
Component Styling
Style one component without changing the theme.
Message Bubble Styling
Incoming, outgoing and per-kind bubble styles.
Localize
Languages and date formats.