AI Integration Quick Reference
AI Integration Quick Reference
The
CometChatMessageComposer component enables users to write and send messages including text, images, videos, audio, files, and custom messages. It supports attachments, voice recording, stickers, mentions, and AI-powered features.

Where It Fits
CometChatMessageComposer provides a rich text input with attachment, emoji, voice recording, sticker, and send controls. Wire it alongside CometChatMessageHeader and CometChatMessageList to build a standard chat view.

Minimal Render

Actions and Events
Callback Props
onSendButtonClick
Fires when the send button is clicked. Overrides the default send behavior.onTextChangedListener
Fires as the user types in the composer input.onError
Fires on internal errors.SDK Events (Real-Time, Automatic)
The component internally handles typing indicators and message sending. No manual SDK listener attachment needed.Custom View Slots
headerView
Custom view above the composer input.
footerView
Custom view below the composer input.sendButtonView
Replace the send button.auxillaryButtonView
Replace the sticker and AI button area.attachmentOptions
Override the default attachment options.Common Patterns
Thread composer
Minimal composer — text only
Pre-filled text
Disable typing indicators
Disable mentions
Custom send button action
Styling
Style Hierarchy
- Global styles (
CometChatMessageComposer.style) apply to all instances - Instance styles override global for specific instances
Global Level Styling
Instance Level Styling

Key Style Properties
Sub-Component Styles
Customization Matrix
Props
All props are optional. Sorted alphabetically.Methods
set(textFormatter:)
Sets a custom text formatter for the composer input.setDisableMentionAll(_:)
Disables or enables the @all mention feature that notifies all group members.setMentionAllLabel(::)
Customizes the label displayed for @all mentions in the suggestions list.Related Components
- Message List — Display messages in a conversation
- Message Header — Display user/group details
- Mentions Formatter — Configure @mention formatting