AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Package | @cometchat/chat-uikit-react |
| Key class | CometChatUrlsFormatter (extends CometChatTextFormatter) |
| Required setup | CometChatUIKit.init(UIKitSettings) then CometChatUIKit.login("UID") |
| Purpose | Auto-detects URLs in text messages and converts them to clickable links |
| Sample app | GitHub |
| Related | Custom Text Formatter | All Guides |
CometChatUrlsFormatter extends CometChatTextFormatter to detect URLs in text messages and render them as clickable links.

Usage
ExtendCometChatTextFormatter, set regex patterns for URL detection, and override onRegexMatch and registerEventListeners to handle formatting and click behavior.
- TypeScript
Customization
Styling links
Apply CSS to your link class:Handling clicks
OverrideonUrlClick to add tracking or custom navigation: