AI Integration Quick Reference
AI Integration Quick Reference
CometChatUrlsFormatter extends CometChatTextFormatter to detect URLs, email addresses, and phone numbers in text messages and render them as clickable links using React Native’s Linking API.
Features
Usage
TheCometChatUrlsFormatter is included by default in the UI Kit. You can also create a custom instance with custom styling:
- TypeScript
Customization
Styling Links
Use thesetStyle method to customize link appearance:
Style Properties
How It Works
TheCometChatUrlsFormatter uses regex patterns to detect:
- URLs: HTTP and HTTPS links
- Emails: Email addresses (opens
mailto:link) - Phone numbers: Phone numbers (opens
tel:link)
Linking API to open the appropriate handler:
Combining with Other Formatters
You can use multiple formatters together. The order matters — formatters are applied in sequence:Next Steps
Custom Text Formatter
Build custom inline text patterns.
Mentions Formatter
Add @mentions with styled tokens.
All Guides
Browse all feature and formatter guides.
Sample App
Full working sample application on GitHub.