ChatComponentFactory

Factory for creating stateless components that are used by default throughout the Chat UI.

Example of a custom ChatComponentFactory implementation that changes the default UI of the trailing content of the channel list header element:

ChatTheme(
componentFactory = object : ChatComponentFactory() {
@Composable
override fun RowScope.ChannelListHeaderTrailingContent(
params: ChannelListHeaderTrailingContentParams,
) {
IconButton(onClick = params.onHeaderActionClick) {
Icon(
imageVector = Icons.Default.Add,
contentDescription = "Add",
)
}
}
}
) {
// Your Chat screens
}

ChatComponentFactory can also be extended in a separate class and passed to the ChatTheme as shown:

class MyChatComponentFactory : ChatComponentFactory {
@Composable
override fun RowScope.ChannelListHeaderTrailingContent(
params: ChannelListHeaderTrailingContentParams,
) {
IconButton(onClick = params.onHeaderActionClick) {
Icon(
imageVector = Icons.Default.Add,
contentDescription = "Add",
)
}
}
}

ChatTheme(
componentFactory = MyComponentFactory()
) {
// Your Chat screens
}

Functions

Link copied to clipboard

Camera capture interface for taking photos or recording videos.

Link copied to clipboard

Slash command picker showing available commands.

Link copied to clipboard

List picker for selecting files from device storage.

Link copied to clipboard

Grid picker for selecting images and videos from device storage.

Link copied to clipboard

Main attachment picker component with mode tabs and content area.

Link copied to clipboard

Content router that displays the appropriate picker UI based on the current mode.

Link copied to clipboard

Container component that manages the attachment picker's visibility and animations.

Link copied to clipboard

Poll creation entry point in the attachment picker.

Link copied to clipboard

System picker variant that uses native OS pickers instead of in-app UI.

Link copied to clipboard

Tab bar for the in-app attachment picker showing toggle buttons for each mode.

Link copied to clipboard

Button bar for the system attachment picker showing action buttons for each mode.

Link copied to clipboard

Factory method for creating the content of audio recording attachments in a message.

Link copied to clipboard
open fun Avatar(params: AvatarParams)

The default avatar component that displays an image from a URL or falls back to a placeholder. This component serves as the foundational UI for all avatar types.

Link copied to clipboard

The default avatar for a channel.

Link copied to clipboard

Factory method for creating the empty content of the channel files attachments screen.

Link copied to clipboard

The default error content of the channel files attachments screen.

Link copied to clipboard

Factory method for creating the channel files attachments header item. This is typically used to display the title of a group of attachments.

Link copied to clipboard

Factory method for creating the channel files attachments item.

Link copied to clipboard

Factory method for creating a divider between channel files attachments items.

Link copied to clipboard

Factory method for creating the loading indicator of the channel files attachments screen.

Link copied to clipboard

Factory method for creating the loading item in the channel files attachments list.

Link copied to clipboard

Factory method for creating the top bar of the channel files attachments screen.

Link copied to clipboard

The default header of the message list. Usually a back button as a leading content, the channel title in the top center, the channel information or the connection status in the bottom center, and the channel avatar as the trailing content.

Link copied to clipboard

The default center content of the message list header. Usually shows the channel title in the top and the channel information or the connection status in the bottom.

Link copied to clipboard

The default leading content of the message list header, which is the back button.

Link copied to clipboard

The default trailing content of the message list header, which is the channel avatar.

Link copied to clipboard

Factory method for creating the top bar of the member info modal sheet in the group channel info screen.

Link copied to clipboard

Factory method for creating a single member option item.

Link copied to clipboard

Factory method for creating the channel info option item used in direct and group channel info screens.

Link copied to clipboard

Factory method for creating the channel info screen modal.

Link copied to clipboard

Factory method for creating the channel info separator item. This is used to visually separate different sections in the channel info screens.

Link copied to clipboard

The default center content of the channel item. Usually the name of the channel and the last message.

Link copied to clipboard

The default draft message preview in the channel item, showing the "Draft:" label and draft text.

Link copied to clipboard

The default leading content of the channel item. Usually the avatar that holds an image of the channel or its members.

Link copied to clipboard

The default message preview in the channel item, showing the sender name and message content.

Link copied to clipboard

The default read status indicator in the channel item, whether the last message is sent, pending or read.

Link copied to clipboard

The default trailing content of the channel item. Usually information about the last message such as its read state, timestamp, and the number of unread messages.

Link copied to clipboard

The default unread count indicator in the channel item.

Link copied to clipboard

The default divider between channel items.

Link copied to clipboard

The default empty content of the channel list.

Link copied to clipboard

The default empty search content of the channel list, when there are no matching search results.

Link copied to clipboard

The default header shown above the channel list. Usually contains the current user's avatar, a title or the connected status, and an action button.

Link copied to clipboard

The default center content of the channel list header. Usually shows the title if connectionState is ConnectionState.Connected, a Disconnected text if connectionState is offline, or NetworkLoadingIndicator otherwise.

Link copied to clipboard

The default leading content of the channel list header. Usually the avatar of the current user if it's available.

Link copied to clipboard

The default trailing content of the channel list header. Usually an action button.

Link copied to clipboard

The default helper content of the channel list. It's empty by default and can be used to implement a scroll to top feature.

Link copied to clipboard

The default channel list item content. When swipe actions are enabled and a SwipeRevealCoordinator is provided, wraps the item in SwipeableChannelItem.

Link copied to clipboard

The default loading indicator of the channel list, when the initial data is loading.

Link copied to clipboard

The default loading more item, when the next page of the channel list is loading.

Link copied to clipboard

The default search input of the channel list.

Link copied to clipboard

Factory method for creating the empty content of the channel media attachments screen.

Link copied to clipboard

The default error content of the channel media attachments screen.

Link copied to clipboard

Factory method for creating the channel media attachments floating header. This is typically used to display the title of a group of attachments.

Link copied to clipboard

Factory method for creating the channel media attachments item.

Link copied to clipboard

Factory method for creating the loading indicator of the channel media attachments screen.

Link copied to clipboard

Factory method for creating the loading item in the channel media attachments list.

Link copied to clipboard

Factory method for creating the bottom bar of the channel media attachments preview screen.

Link copied to clipboard

Factory method for creating the top bar of the channel media attachments preview screen.

Factory method for creating the title of the channel media attachments preview top bar. This displays the message sender's name and the time when the message was sent.

Link copied to clipboard

Factory method for creating the top bar of the channel media attachments screen.

Link copied to clipboard

Factory method for creating the full content of the SelectedChannelMenu.

Link copied to clipboard

Factory method for creating the center content of the SelectedChannelMenu.

Link copied to clipboard

Factory method for creating the header content of the SelectedChannelMenu.

Link copied to clipboard

Factory method for creating the options content of the SelectedChannelMenu.

Link copied to clipboard

Factory method for creating a single channel option item.

Link copied to clipboard

Factory method for creating the leading icon of the Channel options menu item.

Link copied to clipboard

The swipe actions revealed when swiping a channel list item. Override this to provide custom swipe actions.

Link copied to clipboard

Factory method for creating the content of custom attachments in a message.

Link copied to clipboard

Factory method for creating the avatar container in the direct channel info screen.

Link copied to clipboard

Factory method for creating the top bar of the channel info screen.

Link copied to clipboard

Factory method for creating the content of file attachments in a message.

Link copied to clipboard

Factory method for creating a file attachment item.

Link copied to clipboard

Factory method for creating the content of Giphy attachments in a message.

Link copied to clipboard

Factory method for creating the "Add members" button of the group channel info screen.

Link copied to clipboard

Factory method for creating the avatar container in the group channel info screen.

Link copied to clipboard

Factory method for creating the expand members item in the group channel info screen.

Link copied to clipboard

Factory method for creating the member item in the group channel info screen.

Link copied to clipboard

Factory method for creating the member section card in the group channel info screen.

Link copied to clipboard

Factory method for creating the top bar of the group channel info screen.

Link copied to clipboard

Factory method for creating the content of link attachments in a message.

Link copied to clipboard

Factory method for creating the content of media attachments in a message.

Link copied to clipboard

The default empty placeholder that is displayed when the mention list is empty.

Link copied to clipboard

The default content of a mention list item.

Link copied to clipboard

The default loading indicator that is displayed during the initial loading of the mention list.

Link copied to clipboard

The default loading indicator that is displayed on the bottom of the list when there are more mentions loading.

Link copied to clipboard

The default pull-to-refresh indicator for the mention list.

Link copied to clipboard

Factory method for creating a generic menu option item.

Link copied to clipboard

Factory method for creating the full content of the MessageActions overlay. This is the menu that appears when a message is long-pressed.

Link copied to clipboard

Factory method for creating the header content of the MessageActions overlay.

Link copied to clipboard

Shows the default message options.

Link copied to clipboard

Factory method for creating an individual action item in the MessageActions overlay.

Link copied to clipboard

The default author content for a message. Usually shows the avatar of the user if the message doesn't belong to the current user.

Link copied to clipboard

The default bottom content inside the message bubble. Usually shows timestamp and delivery status.

Link copied to clipboard

The default appearance of the message bubble.

Link copied to clipboard

The default message composer that contains the message input, attachments, commands, recording actions, integrations, and the send button.

Link copied to clipboard

Renders a single audio recording attachment item in the message composer tray.

Link copied to clipboard

Renders a single generic file attachment item in the message composer tray.

Link copied to clipboard

Renders a single media (image or video) attachment item in the message composer tray.

Link copied to clipboard

Renders all selected attachments in the message composer as a single horizontal scrolling row.

Link copied to clipboard

The default "Audio recording (voice message)" button of the message composer.

The floating lock icon displayed above the recording content during RecordingState.Hold and RecordingState.Locked states.

Link copied to clipboard

The "Hold to record" instructional hint displayed as a snackbar when the user taps the record button without holding.

Link copied to clipboard

The content displayed in the message composer while the user is holding to record audio.

The content displayed in the message composer when the recording is locked (finger released while recording continues).

The content displayed in the message composer when the recording is stopped and the user can scrub the waveform and play back before sending.

The permission rationale displayed as a snackbar when the audio recording permission needs explanation. Shows a message and a "Settings" action button.

Link copied to clipboard

The default command suggestion item of the message composer.

The default center content of the command suggestion item of the message composer.

The default leading content of the command suggestion item of the message composer.

Link copied to clipboard

The default cooldown indicator of the message composer. Shown when the user is prevented from sending messages due to a cooldown.

Link copied to clipboard

The edit indicator shown inside the composer's header when the user edits a message. Previews the original message text and attachment type.

Link copied to clipboard

The default input of the message composer.

Link copied to clipboard

The default bottom content of the message composer input. Shown at the bottom of the composer input, below the text field.

Link copied to clipboard

The default center content of the message composer input. Contains the text input field (BasicTextField) with label overlay.

Link copied to clipboard

The default leading content of the message composer input row. Shown at the start of the composer input, before the text field. When a command is active, renders a CommandChip.

Link copied to clipboard

The default trailing content of the message composer. Shown at the end of the composer input.

Link copied to clipboard

The default leading content of the message composer, which includes an add attachment button by default.

Link copied to clipboard

Shows a preview of the link that the user has entered in the message composer. Shows the link image preview, the title of the link and its description.

Link copied to clipboard

The default appearance of a quoted message in the message composer. Shown when the user quotes (replies to) a message in the composer.

Link copied to clipboard

The default "Save" button of the message composer, shown when editing a message. Displays a checkmark icon in a filled circular button.

Link copied to clipboard

The default "Send" button of the message composer.

Link copied to clipboard

The default trailing content of the message composer. Shown after the composer input.

Link copied to clipboard

The default user suggestion item of the message composer.

The default center content of the user suggestion item of the message composer.

The default leading content of the user suggestion item of the message composer.

The default trailing content of the user suggestion item of the message composer.

Link copied to clipboard

The default container for a regular message, which includes the author avatar, message bubble, and reactions.

Link copied to clipboard

The default content of the message bubble. Usually contains attachments and text.

Link copied to clipboard

The default content of a deleted message.

Link copied to clipboard

Icon shown at the bottom-end of a Message when it failed to send.

Link copied to clipboard

The default footer content. Usually contains either MessageThreadFooter or the default footer, which holds the sender name and the timestamp.

Link copied to clipboard

The default message footer status indicator. Displays the delivery or read status icon of a message.

Link copied to clipboard

The message footer while uploading attachments. Empty by default.

Link copied to clipboard

The default Giphy message content.

Link copied to clipboard

The default message item component, which renders each MessageListItemState's subtype. This includes date separators, system messages, and regular messages.

Link copied to clipboard

The default background of the message list.

Link copied to clipboard

The default date separator item content of the message list.

Link copied to clipboard

The default empty content of the message list, when the message list is empty.

The default empty thread placeholder item content of the message list.

Link copied to clipboard

The default helper content of the message list. It handles the scroll-to-bottom and scroll-to-focused message features.

Link copied to clipboard

The default message list item modifier for styling.

Link copied to clipboard

The default loading indicator of the message list, when the initial message list is loading.

Link copied to clipboard

The default loading more item of the message list, when the next page of messages is loading.

Link copied to clipboard

The default moderated message content of the message list.

Link copied to clipboard

The default start of the channel item content of the message list.

Link copied to clipboard

The default system message content of the message list.

The default thread date separator item content of the message list.

Link copied to clipboard

The default typing indicator content of the message list.

Link copied to clipboard

The default unread separator item content of the message list.

Link copied to clipboard

The default quoted message content. Usually shows only the sender avatar, text and a single attachment preview.

Link copied to clipboard

Factory method for creating the reaction picker bottom sheet.

Link copied to clipboard

The component displaying the reactions on a message. Defaults to SegmentedMessageReactions, but an equivalent implementation with a different visual style is available through ClusteredMessageReactions.

Link copied to clipboard

Factory method for creating the content of the reaction picker bottom sheet.

Link copied to clipboard

The default content of a regular message that can contain attachments and text.

Link copied to clipboard

The empty space in the message item opposite to the message bubble. For example, for outgoing messages, by default the spacer is placed before the bubble.

Link copied to clipboard

The default message text content. Usually with extra styling and padding for the chat bubble.

Link copied to clipboard

The default top content inside the message bubble. Usually shows pinned indicator and thread labels.

Link copied to clipboard

The default empty placeholder that is displayed when there are no pinned messages.

Link copied to clipboard

The default content of the pinned message list item.

Link copied to clipboard

The default center content of the pinned message list item. Shows the message sender name and the message content.

Link copied to clipboard

The default divider appended after each pinned message.

Link copied to clipboard

The default leading content of the pinned message list item. Shows an avatar of the user who sent the pinned message.

Link copied to clipboard

The default trailing content of the pinned message list item. Shows the message timestamp.

Link copied to clipboard

The default loading content that is displayed during the initial loading of the pinned messages.

Link copied to clipboard

The default content shown on the bottom of the list during the loading of more pinned messages.

Link copied to clipboard

Factory method for creating a reaction icon. By default, it only displays the emoji.

Link copied to clipboard

Factory method for creating a single reaction option item in the reactions menu.

Link copied to clipboard

Factory method for creating the menu displaying all the reactions on a message.

Link copied to clipboard

Factory method for creating the content of the reactions menu.

Link copied to clipboard

Factory method for creating a reaction toggle. By default, it only displays the emoji.

Link copied to clipboard

The default scroll-to-bottom button shown when the user scrolls away from the bottom of the list.

Link copied to clipboard

The default clear button of the search input.

Link copied to clipboard

The default label of the search input.

Link copied to clipboard

The default leading icon of the search input.

Link copied to clipboard

The default center content of a search result item. Shows information about the message and by who and where it was sent.

Link copied to clipboard

The default search result item of the channel list.

Link copied to clipboard

The default leading content of a search result item. Shows the avatar of the user who sent the message.

Link copied to clipboard

The default trailing content of a search result item. Shows the message timestamp.

Link copied to clipboard

The default content shown when swiping to reply to a message.

Link copied to clipboard

The default thread list banner. Shows unread thread count, a loading indicator during refresh, or an error prompt.

Link copied to clipboard

The default empty placeholder that is displayed when there are no threads.

Link copied to clipboard

The default header shown above the thread list. Displays the user avatar and a title, typically "Threads", with no trailing action button.

Link copied to clipboard

The default thread list item. Shows information about the Thread title, parent message, last reply and number of unread replies.

Link copied to clipboard

The default loading content that is displayed during the initial loading of the threads.

Link copied to clipboard

The default content shown on the bottom of the list during the loading of more threads.

Link copied to clipboard

The default user avatar content.