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
Camera capture interface for taking photos or recording videos.
Slash command picker showing available commands.
List picker for selecting files from device storage.
Grid picker for selecting images and videos from device storage.
Main attachment picker component with mode tabs and content area.
Content router that displays the appropriate picker UI based on the current mode.
Container component that manages the attachment picker's visibility and animations.
Poll creation entry point in the attachment picker.
System picker variant that uses native OS pickers instead of in-app UI.
Tab bar for the in-app attachment picker showing toggle buttons for each mode.
Button bar for the system attachment picker showing action buttons for each mode.
Factory method for creating the content of audio recording attachments in a message.
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.
The default avatar for a channel.
Factory method for creating the empty content of the channel files attachments screen.
The default error content of the channel files attachments screen.
Factory method for creating the channel files attachments header item. This is typically used to display the title of a group of attachments.
Factory method for creating the channel files attachments item.
Factory method for creating a divider between channel files attachments items.
Factory method for creating the loading indicator of the channel files attachments screen.
Factory method for creating the loading item in the channel files attachments list.
Factory method for creating the top bar of the channel files attachments screen.
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.
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.
The default leading content of the message list header, which is the back button.
The default trailing content of the message list header, which is the channel avatar.
Factory method for creating the top bar of the member info modal sheet in the group channel info screen.
Factory method for creating a single member option item.
Factory method for creating the channel info option item used in direct and group channel info screens.
Factory method for creating the channel info screen modal.
Factory method for creating the channel info separator item. This is used to visually separate different sections in the channel info screens.
The default center content of the channel item. Usually the name of the channel and the last message.
The default draft message preview in the channel item, showing the "Draft:" label and draft text.
The default leading content of the channel item. Usually the avatar that holds an image of the channel or its members.
The default message preview in the channel item, showing the sender name and message content.
The default read status indicator in the channel item, whether the last message is sent, pending or read.
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.
The default unread count indicator in the channel item.
The default divider between channel items.
The default empty content of the channel list.
The default empty search content of the channel list, when there are no matching search results.
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.
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.
The default leading content of the channel list header. Usually the avatar of the current user if it's available.
The default trailing content of the channel list header. Usually an action button.
The default helper content of the channel list. It's empty by default and can be used to implement a scroll to top feature.
The default channel list item content. When swipe actions are enabled and a SwipeRevealCoordinator is provided, wraps the item in SwipeableChannelItem.
The default loading indicator of the channel list, when the initial data is loading.
The default loading more item, when the next page of the channel list is loading.
The default search input of the channel list.
Factory method for creating the empty content of the channel media attachments screen.
The default error content of the channel media attachments screen.
Factory method for creating the channel media attachments floating header. This is typically used to display the title of a group of attachments.
Factory method for creating the channel media attachments item.
Factory method for creating the loading indicator of the channel media attachments screen.
Factory method for creating the loading item in the channel media attachments list.
Factory method for creating the bottom bar of the channel media attachments preview screen.
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.
Factory method for creating the top bar of the channel media attachments screen.
Factory method for creating the full content of the SelectedChannelMenu.
Factory method for creating the center content of the SelectedChannelMenu.
Factory method for creating the header content of the SelectedChannelMenu.
Factory method for creating the options content of the SelectedChannelMenu.
Factory method for creating a single channel option item.
Factory method for creating the leading icon of the Channel options menu item.
The swipe actions revealed when swiping a channel list item. Override this to provide custom swipe actions.
Factory method for creating the content of custom attachments in a message.
Factory method for creating the avatar container in the direct channel info screen.
Factory method for creating the top bar of the channel info screen.
Factory method for creating the content of file attachments in a message.
Factory method for creating a file attachment item.
Factory method for creating the content of Giphy attachments in a message.
Factory method for creating the "Add members" button of the group channel info screen.
Factory method for creating the avatar container in the group channel info screen.
Factory method for creating the expand members item in the group channel info screen.
Factory method for creating the member item in the group channel info screen.
Factory method for creating the member section card in the group channel info screen.
Factory method for creating the top bar of the group channel info screen.
Factory method for creating the content of link attachments in a message.
Factory method for creating the content of media attachments in a message.
The default empty placeholder that is displayed when the mention list is empty.
The default content of a mention list item.
The default loading indicator that is displayed during the initial loading of the mention list.
The default loading indicator that is displayed on the bottom of the list when there are more mentions loading.
The default pull-to-refresh indicator for the mention list.
Factory method for creating a generic menu option item.
Factory method for creating the full content of the MessageActions overlay. This is the menu that appears when a message is long-pressed.
Factory method for creating the header content of the MessageActions overlay.
Shows the default message options.
Factory method for creating an individual action item in the MessageActions overlay.
The default author content for a message. Usually shows the avatar of the user if the message doesn't belong to the current user.
The default bottom content inside the message bubble. Usually shows timestamp and delivery status.
The default appearance of the message bubble.
The default message composer that contains the message input, attachments, commands, recording actions, integrations, and the send button.
Renders a single audio recording attachment item in the message composer tray.
Renders a single generic file attachment item in the message composer tray.
Renders a single media (image or video) attachment item in the message composer tray.
Renders all selected attachments in the message composer as a single horizontal scrolling row.
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.
The "Hold to record" instructional hint displayed as a snackbar when the user taps the record button without holding.
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.
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.
The default cooldown indicator of the message composer. Shown when the user is prevented from sending messages due to a cooldown.
The edit indicator shown inside the composer's header when the user edits a message. Previews the original message text and attachment type.
The default input of the message composer.
The default bottom content of the message composer input. Shown at the bottom of the composer input, below the text field.
The default center content of the message composer input. Contains the text input field (BasicTextField) with label overlay.
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.
The default trailing content of the message composer. Shown at the end of the composer input.
The default leading content of the message composer, which includes an add attachment button by default.
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.
The default appearance of a quoted message in the message composer. Shown when the user quotes (replies to) a message in the composer.
The default "Save" button of the message composer, shown when editing a message. Displays a checkmark icon in a filled circular button.
The default "Send" button of the message composer.
The default trailing content of the message composer. Shown after the composer input.
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.
The default container for a regular message, which includes the author avatar, message bubble, and reactions.
The default content of the message bubble. Usually contains attachments and text.
The default content of a deleted message.
Icon shown at the bottom-end of a Message when it failed to send.
The default footer content. Usually contains either MessageThreadFooter or the default footer, which holds the sender name and the timestamp.
The default message footer status indicator. Displays the delivery or read status icon of a message.
The message footer while uploading attachments. Empty by default.
The default Giphy message content.
The default message item component, which renders each MessageListItemState's subtype. This includes date separators, system messages, and regular messages.
The default background of the message list.
The default date separator item content of the message list.
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.
The default helper content of the message list. It handles the scroll-to-bottom and scroll-to-focused message features.
The default message list item modifier for styling.
The default loading indicator of the message list, when the initial message list is loading.
The default loading more item of the message list, when the next page of messages is loading.
The default moderated message content of the message list.
The default start of the channel item content of the message list.
The default system message content of the message list.
The default thread date separator item content of the message list.
The default typing indicator content of the message list.
The default unread separator item content of the message list.
The default quoted message content. Usually shows only the sender avatar, text and a single attachment preview.
Factory method for creating the reaction picker bottom sheet.
The component displaying the reactions on a message. Defaults to SegmentedMessageReactions, but an equivalent implementation with a different visual style is available through ClusteredMessageReactions.
Factory method for creating the content of the reaction picker bottom sheet.
The default content of a regular message that can contain attachments and text.
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.
The default message text content. Usually with extra styling and padding for the chat bubble.
The default top content inside the message bubble. Usually shows pinned indicator and thread labels.
The default empty placeholder that is displayed when there are no pinned messages.
The default content of the pinned message list item.
The default center content of the pinned message list item. Shows the message sender name and the message content.
The default divider appended after each pinned message.
The default leading content of the pinned message list item. Shows an avatar of the user who sent the pinned message.
The default trailing content of the pinned message list item. Shows the message timestamp.
The default loading content that is displayed during the initial loading of the pinned messages.
The default content shown on the bottom of the list during the loading of more pinned messages.
Factory method for creating a reaction icon. By default, it only displays the emoji.
Factory method for creating a single reaction option item in the reactions menu.
Factory method for creating the menu displaying all the reactions on a message.
Factory method for creating the content of the reactions menu.
Factory method for creating a reaction toggle. By default, it only displays the emoji.
The default scroll-to-bottom button shown when the user scrolls away from the bottom of the list.
The default clear button of the search input.
The default label of the search input.
The default leading icon of the search input.
The default center content of a search result item. Shows information about the message and by who and where it was sent.
The default search result item of the channel list.
The default leading content of a search result item. Shows the avatar of the user who sent the message.
The default trailing content of a search result item. Shows the message timestamp.
The default content shown when swiping to reply to a message.
The default thread list banner. Shows unread thread count, a loading indicator during refresh, or an error prompt.
The default empty placeholder that is displayed when there are no threads.
The default header shown above the thread list. Displays the user avatar and a title, typically "Threads", with no trailing action button.
The default thread list item. Shows information about the Thread title, parent message, last reply and number of unread replies.
The default loading content that is displayed during the initial loading of the threads.
The default content shown on the bottom of the list during the loading of more threads.
The default user avatar content.