Skip to main content
Every component in the UI Kit follows a layered architecture. Understanding these layers is the key to deep customization without rebuilding components from scratch.

Architecture Layers

Each component is built from four layers, from outermost (UI) to innermost (data): The ViewModel lives in chatuikit-core and is shared by both Kotlin XML Views and Jetpack Compose. The View layer is module-specific.

Overriding the ViewModel

Every component accepts an external ViewModel. This lets you subclass the default ViewModel to override behavior, or provide a completely custom one.

Overriding the Repository

Each ViewModel is created via a Factory that accepts a custom Repository. Implement the repository interface to change how data is fetched.
Available repository interfaces in chatuikit-core:

ListOperations API

All list-based ViewModels implement the ListOperations<T> interface, giving you a consistent API to manipulate list data programmatically.

Available Operations

Example

Batch operations are critical for performance when handling rapid updates (e.g., multiple messages arriving simultaneously).

SDK Listeners vs UIKit Events

ViewModels use two event systems for real-time updates: Both are needed for full functionality. SDK listeners handle server-pushed events, UIKit events handle inter-component communication.

Customization Categories

View Slots

Replace specific regions of a component’s UI (leading view, title, subtitle, trailing view).

Styles

Customize visual appearance using XML theme attributes or Compose style data classes.

ViewModel & Data

Configure data fetching, observe state flows, and call mutation methods on the ViewModel.

Events & Callbacks

Handle click events, selection mode, and global UI Kit events.

State Views

Replace or restyle the default empty, error, and loading state views.

Text Formatters

Create custom text processors for hashtags, mentions, links, or any pattern.

Menu & Options

Add, replace, or extend context menu actions and composer attachment options.

What’s Next

Start with Styles for quick visual changes, or ViewModel & Data for behavior customization.