Skip to main content
FieldValue
GoalCustomize UI Kit appearance (colors, fonts, spacing) via Flutter ThemeExtensions
WhereThemeData.extensions in MaterialApp
ColorCometChatColorPalette — primary, neutral, alert, text, icon, background colors
TypographyCometChatTypography — font sizes, weights, text styles
SpacingCometChatSpacing — padding, margin, border radius
Dark modeUse separate CometChatColorPalette for dark theme
SourceGitHub
Theming controls the look and feel of the chat UI — colors, fonts, and spacing — through Flutter’s ThemeExtension system.

Core Components

ComponentClassPurpose
ColorCometChatColorPalettePrimary, neutral, alert, text, icon, background colors
TypographyCometChatTypographyFont sizes, weights, text styles
SpacingCometChatSpacingPadding, margin, border radius

Typography Tokens

TokenPurpose
heading1 - heading4Heading text styles
bodyBody text
caption1, caption2Caption text
buttonButton text
linkLink text
titleTitle text

Spacing Tokens

TokenDefault Value
spacing - spacing202px - 80px (increments of 4)
padding - padding10Derived from spacing
margin - margin20Derived from spacing
radius - radius6, radiusMaxBorder radius values

Basic Usage

Override theme properties in your MaterialApp:
main.dart
MaterialApp(
  theme: ThemeData(
    fontFamily: 'Roboto',
    extensions: [
      CometChatColorPalette(
        primary: Color(0xFFF76808),
        textPrimary: Color(0xFF141414),
        background1: Color(0xFFFFFFFF),
      ),
    ],
  ),
  home: MyApp(),
)

Light and Dark Themes

ThemeData(
  extensions: [
    CometChatColorPalette(
      primary: Color(0xFF6852D6),
      textPrimary: Color(0xFF141414),
      textSecondary: Color(0xFF727272),
      background1: Color(0xFFFFFFFF),
      borderLight: Color(0xFFF5F5F5),
    ),
  ],
)

Custom Brand Colors

ThemeData(
  fontFamily: 'Times New Roman',
  extensions: [
    CometChatColorPalette(
      primary: Color(0xFFF76808),
      iconHighlight: Color(0xFFF76808),
      extendedPrimary500: Color(0xFFFBAA75),
    ),
  ],
)

Next Steps