Props reference
Every group below is collapsed - open the one you need.
Core configuration, refs & theming
Core Configuration
messages(Array) - Messages to displayuser(Object) - User sending the messages:{ _id, name, avatar }onSend(Function) - Callback when sending a messagemessageIdGenerator(Function) - Generate an id for new messages. Defaults to a simple random string generator.locale(String) - Locale to localize the dates. You need first to import the locale you need (ie.require('dayjs/locale/de')orimport 'dayjs/locale/fr')colorScheme('light' | 'dark') - Force color scheme (light/dark mode). When set to'light'or'dark', it overrides the system color scheme. Whenundefined, it uses the system color scheme. Default isundefined.theme(Object) - Override the default light theme tokens (colors/radii/spacing/typography/avatar/sendButton/composer/voice/bubble/wallpaper/nameColors). Deep-merged overdefaultLightTheme; any subset is allowed. See Theming & Dark Mode.renderWallpaper(Function | null) - The chat background. By defaultChatdraws a swirl gradient fromtheme.wallpaper, turning one step per message you send. Return your own element (an image,ChatWallpaperwith other props...) to replace it, or passnullfor the plaintheme.colors.background.darkTheme(Object) - Same astheme, applied when the resolved color scheme is dark (deep-merged overdefaultDarkTheme).icons(Object) - Icon override registry. Supply a render function for any built-in icon to replace it (e.g. withlucide-react-native). See Custom icons.labels(Object) - Override any UI string. See Localization (i18n).
Refs
messagesContainerRef(LegendListRef) - Ref to the message list, a Legend List ref:scrollToEnd,scrollToKey(keys are message_ids as strings),scrollToIndex,getState. Indexes count from the oldest messagetextInputRef(TextInput ref) - Ref to the text inputchatRef(ChatHandleref) -chatRef.current.scrollToMessage(id, { animated, viewPosition, isHighlighted })scrolls to a message, also one far up the history, and withisHighlightedflashes it the way a tapped quote does. For a search result or a deep link
Keyboard & layout
Keyboard & Layout
-
bottomInset(Number) - The composer's space for the home indicator; measured by default. Pass it when the host already knows it, e.g. a chat inside a sliding panel whose own inset arrives late. It is still given up while the keyboard or the emoji panel covers it -
keyboardProviderProps(Object) - Props to be passed to theKeyboardProviderfor keyboard handling. No defaults are applied - in particular Chat does not setstatusBarTranslucent/navigationBarTranslucent, because on Android those change the activity window and the change outlives the chat screen (#2755).react-native-keyboard-controllerturns them on by itself when the app is genuinely edge-to-edge, so there is nothing to set in a normal app.Only used when Chat mounts the provider itself. If your app already mounts a
KeyboardProvider(the setupreact-native-keyboard-controllerrecommends - once, at the root), Chat detects it and reuses it instead of nesting a second one, and this prop is ignored. Configure the provider where you mount it. -
enableKeyboardProvider(Bool) - Render the built-inKeyboardProvider; default istrue. You do not need to turn this off just because your app mounts its own provider - that case is detected and reused. Set it tofalseonly to opt out completely, e.g. when the provider's edge-to-edge behavior causes layout shift or a header jump on Android/Expo. -
enableGestureHandlerRootView(Bool) - Render theGestureHandlerRootViewChat mounts around itself; default istrue. UnlikeKeyboardProvider, an existing one can't be auto-detected -react-native-gesture-handlerdoesn't expose that publicly - so set this tofalseyourself if your app (or a library it uses, e.g. a bottom sheet) already mounts one at the root. Nesting a second one changes the native view hierarchy around the composer, which has been observed to make a rare Fabric/Yoga layout assertion on iOS more likely, especially when Chat is mounted and unmounted while the keyboard is open (#17). -
keyboardAvoidingViewProps(Object) - Props to be passed to theKeyboardAvoidingView. See keyboardVerticalOffset below for proper keyboard handling. -
isAlignedTop(boolean | 'auto') - Where the bubbles sit while the whole conversation fits on screen; once it is taller than the list this has no effect.false(default) keeps the usual bottom-anchored chat,truepins the messages to the top, and'auto'pins them to the top while the keyboard is closed and re-anchors them to the bottom while it is open - so a short conversation starts under the header and moves above the keyboard when the composer is focused (#2736). Works with eitherisInvertedsetting. -
isInverted(Bool) - Reverses display order ofmessages; default istrue
Understanding keyboardVerticalOffset
keyboardVerticalOffset tells the KeyboardAvoidingView how far down the screen its container starts. That distance depends on the navigation header and on anything else you render above the chat.
You do not normally need to set it. Chat measures its own position on screen and uses that, so the input toolbar sits on the keyboard whether the chat is full-screen or under a navigation header. The measurement comes from the SafeAreaProvider frame and updates on rotation and layout changes.
Pass your own value only to add extra space above the keyboard - it replaces the measured one:
<Chat keyboardAvoidingViewProps={{ keyboardVerticalOffset: headerHeight + 16 }} />
If you do, sanity-check it on device: a toolbar behind the keyboard means the value is too small, a gap above the keyboard means it is too large. useHeaderHeight() is the usual source, but some navigator setups report a value that does not match the header you actually render.
Upgrading from 4.1.0 or earlier: the default used to be
insets.top, which could not account for a navigation header - so most apps passeduseHeaderHeight()to compensate. That is no longer needed; drop it and let Chat measure, or the toolbar will float above the keyboard by the header height.
Text input, composer & actions
Text Input & Composer
text(String) - Input text; default isundefined, but if specified, it will override Chat's internal state. Useful for managing text state outside of Chat (e.g. with Redux). Don't forget to implementtextInputProps.onChangeTextto update the text state.initialText(String) - Initial text to display in the input fieldonDraftChange(Function) -(draft: string) => void, the user's unsent text as it changes (''once sent). Editing a message sets the draft aside and brings it back afterwards, without reporting the edited text. Save it with the chat and pass it back asinitialTextisSendButtonAlwaysVisible(Bool) - Always show send button in input text composer, disabled while there is nothing to send. By default it shows only with text when voice or video notes can be recorded (their button takes the slot while the composer is empty), and always when neither canisTextOptional(Bool) - Allow sending messages without text (useful for media-only messages); defaultfalse. Use withisSendButtonAlwaysVisiblefor media attachments.isMultiline(Bool) - Whether the composer accepts multiple lines; defaulttrue. Withtruethe return key inserts a newline and you send with the send button. Setfalsefor a single-line composer whose return key sends the message (the keyboard's return key becomes "send" and stays open afterwards).renderInputToolbar(Component | Function) - Custom message composer containerrenderComposer(Component | Function) - Custom text input message composerrenderSend(Component | Function) - Custom send button; you can pass children to the originalSendcomponent quite easily, for example, to use a custom icon (example)renderActions(Component | Function) - Custom action button on the left of the message composerrenderAccessory(Component | Function) - Custom second line of actions below the message composeremojiKeyboard(Bool | Object) - The built-in emoji keyboard behind the composer's emoji button, on by default. It opens in the system keyboard's place at the last keyboard height (200 + the bottom inset before a keyboard was seen) and inserts at the caret, whether or not you controltext.falsehides the emoji button. An object configures it:{ isEnabled?, columns?, categories?, recents?, isSearchEnabled?, renderEmojiKeyboard? }-columnsfixes the column count (default: as many 45pt columns as fit);categoriespicks and orders the tabs ('smileys' | 'animals' | 'food' | 'activities' | 'travel' | 'objects' | 'symbols' | 'flags');recentsisfalseor{ isEnabled?, storageKey?, isPersisted? }(persisted through@react-native-async-storage/async-storagewhen installed);isSearchEnabled(defaulttrue);renderEmojiKeyboard({ onSelect, onBackspace, onClose, height, bottomInset })draws your own keyboard in the panel. Colors and sizes live intheme.emojiKeyboard.onPressEmoji(Function) - Called when the emoji button is pressed, instead of opening the built-in emoji keyboard. Passing it shows the button even withemojiKeyboard={false}.audioRecording(Bool | Object) - Hold-to-record voice notes, on by default whenexpo-audiois installed;false(or{ isEnabled: false }) turns them off. An object configures them:{ isEnabled?, minDurationMs?, maxDurationMs?, isViewOnceEnabled?, onPermissionDenied?, onTooShort?, onError? }.isViewOnceEnabledshows a view-once toggle above the pause button while a take is locked or paused; a take sent with it on reachesonSendwithisViewOnce: true.minDurationMs(default 700) drops takes that long or shorter and callsonTooShort;maxDurationMs(default 600000) sends the take when reached. Requires the optionalexpo-audiopeer (andreact-native-audio-apifor the playback waveform); the mic button is hidden when it is absent. A paused take can be resumed whenreact-native-audio-apiis installed with FFmpeg (the M4A recordings are joined without re-encoding), and trimmed whenexpo-file-systemis installed too; a trimmed take reachesonSendas a 16-bit mono WAV at 24kHz, an untrimmed one as the recorder's M4A.videoRecording(Bool | Object) - Round video notes, on by default whenreact-native-vision-camerais installed;false(or{ isEnabled: false }) turns them off.true/{ isEnabled: true }also offers the system-camera fallback below when vision-camera is missing. An object configures them:{ isEnabled?, maxDuration?, minDurationMs?, isViewOnceEnabled?, onPermissionDenied?, onTooShort?, onError? }.maxDurationis in seconds (default 60);minDurationMs(default 800) drops shorter takes and callsonTooShort;isViewOnceEnabledworks as inaudioRecording, for round notes recorded with vision-camera. Withreact-native-vision-camera5 or newer linked (plus itsreact-native-nitro-modulesandreact-native-nitro-imagepeers; it has no Expo config plugin, so addNSCameraUsageDescription/NSMicrophoneUsageDescriptionand theCAMERA/RECORD_AUDIOpermissions yourself), the record button records a note on the first hold - shared with voice notes when both are enabled, on its own otherwise. ReachingmaxDurationstops into a preview (sends directly withoutexpo-video). Without vision-camera it falls back toexpo-image-picker's system camera, which sends a plain (non-round) video.mediaPlayback(Object) - How voice and round video notes play.{ isAutoPlayNextEnabled?, playbackRate?, onPlaybackRateChange?, isRoundVideoAutoplayEnabled?, isNowPlayingBarEnabled?, isFloatingRoundNoteEnabled?, onMediaRead?, isNearEar?, onTranscribe?, onViewOnceEnd? }.isNowPlayingBarEnabled(defaulttrue) shows a "now playing" bar at the top of the chat while a note plays or is paused.isFloatingRoundNoteEnabled(defaulttrue) keeps a round note that is playing or paused going in a small draggable circle over the list once its row scrolls out of view; set it tofalseto stop the note with its row instead.isAutoPlayNextEnabled(defaulttrue) starts the next newer voice or round note in the chat when one plays to its end. The playback speed is shared by every note;playbackRatesets it, andonPlaybackRateChangereports changes so the app can keep the speed across launches.isRoundVideoAutoplayEnabled(defaultfalse) loops round notes silently in the list instead of holding their first frame.onMediaRead(message)is called when an incoming note withisMediaUnreadstarts playing, so the app can mark it listened.isNearEaris raise to listen: feed it from the app's proximity sensor, and while it istruethe current voice or round note plays through the earpiece (restarting if it was under a second in); when it goes back tofalsethe note pauses and the speaker route returns.onTranscribe(message)shows a transcribe button on voice notes and beside round notes; tapping it calls this, shows a loading outline until the app setsmessage.transcription, then opens the text under the waveform, or in a bubble under the round note (tap again to collapse or expand).onViewOnceEnd(message)is called once a view-once note (isViewOnce) has played to its end or been stopped after starting, so the app can remove it. A view-once round note carries the "1" marker on its play button, never autoplays or floats, and cannot be scrubbed.textInputProps(Object) - props to be passed to the<TextInput>.
Composer height - there are no height props. The composer starts one line tall and grows with its content. Constrain it through
textInputProps.style(e.g.{ maxHeight: 120 }), which is applied after the measured height and wins.
Actions & Action Sheet
attachments(Bool | Object) - The built-in attachment menu behind the composer's paperclip, on by default; the paperclip shows when at least one tab's peer is installed. Tabs:gallery(an in-sheet grid withexpo-media-library, the system picker withexpo-image-pickerotherwise),camera(expo-image-picker; a tab of its own only without the grid, which has a camera tile),file(expo-document-picker) andlocation(expo-location). Picks are sent throughonSend: oneimage/videomessage per photo or video with the caption on the first, afilemessage per document, alocationmessage.falsehides the paperclip. An object configures it:{ isEnabled?, tabs?, pickers?, onPick?, renderAttachmentMenu? }-tabspicks and orders them;pickers({ gallery?, camera?, file? }, each anasync () => PickedAttachment[]that returns[]on cancel) replaces the Expo pickers with your own, for an app that picks with other libraries, and shows that tab without its Expo peer;isGalleryGridEnabled: falseleaves Gallery to the system picker instead of the in-sheet grid, for an app without Android'sREAD_MEDIA_IMAGES/READ_MEDIA_VIDEO;onPick(attachments, { caption })intercepts the picks (PickedAttachment[]) and returns the messages to send,nullto send nothing, or nothing for the default;renderAttachmentMenu({ visible, onClose, tabs, onSend })draws your own menu. Colors live intheme.attachments.actions,onPressActionButtonandrenderActionstake precedence. See Emoji keyboard and attachment menu for the permissions each peer needs.actions(Array) - Action options for the composer "+" button. Array of{ title, action }; addicon(and optionalcolor) to an action to render an attachment grid (tiles) instead of a list. Opens the built-in themedAttachmentSheet- no extra dependency.onPressActionButton(Function) - Callback when the "+" button is pressed (if set, the built-inAttachmentSheetis not shown)actionSheet(Function) - Escape hatch for a custom system action sheet. The bundled@expo/react-native-action-sheetdependency was removed, socontext.actionSheet()defaults to a no-op; pass your own implementation (withActionSheetProviderin your tree) if you relied on it.actionSheetOptionTintColor(String) - Tint color for action labels in the attachment sheet
Messages, container & bubbles
Messages & Message Container
messagesContainerStyle(Object) - Custom style for the messages containerrenderMessage(Component | Function) - Custom message containerrenderLoading(Component | Function) - Render a loading view while the chat measures its layout on mountisLoading(Boolean) - The history is loading. Over an empty list the chat shows a spinner in a service-colored circle (a 28 arc in a 36 circle, growing in from 0.3 over 150ms) in place of the empty-chat card. Messages already passed stay visible, without the spinnermediaTransfer(Object) - Handlers for the media transfer buttons.{ onDownload?, onCancel? }. A message withtransfer: { type, progress?, totalBytes? }draws the progress ring with a cancel ✕ over its photo, video, file, voice or round note (with "1.2 MB / 4.5 MB" whentotalBytesor the file size is known); tapping it callsonCancel(message). A message withisDownloadRequireddraws the download arrow; tapping it callsonDownload(message). WithoutonDownload, a voice note or photo then fetches itself. Remote voice notes, photos and round notes that need no app handling show the same ring while they load, from the request's own progressrenderChatEmpty(Function | null) - What to show while there are no messages. By default a greeting card: "No messages here yet...", a line of help and a big 👋 that sends itself when tapped, centered over the wallpaper. Return your own element to replace it, or passnullfor nothing. The card is exported asChatEmpty.emptyChatGreeting(String | null) - The greeting on the empty-chat card, sent as a message when tapped; default'👋'.nullkeeps just the title.firstUnreadMessageId(String | Number | null) - The first message the user has not read. A full-width "Unread Messages" bar is drawn above it and the chat opens scrolled so the bar is at the top. Keep it fixed while the chat is open (the bar stays until you leave), e.g. computed once from the unread count when the screen mounts.renderUnreadSeparator(Function | null) - Custom "Unread Messages" bar, ornullto only scroll to the first unread message. The default is exported asUnreadSeparator.renderChatFooter(Component | Function) - Custom component to render below the MessagesContainer (separate from the ListView)listProps(Object) - Extra props for the message list, anAnimatedLegendList(e.g.drawDistance,maintainScrollAtEnd,onViewableItemsChanged). The list renders oldest first, not inverted, soonEndReachedfires at the newest message. Handlers the list uses itself (onScrollBeginDrag/onScrollEndDrag,onMomentumScrollBegin/onMomentumScrollEnd,onContentSizeChange,onItemSizeChanged,onMetricsChange,onLayout, the viewability callbacks) run after its own, andcontentContainerStylegoes on top of its padding.
Message Bubbles & Content
renderBubble(Component | Function(props: BubbleProps)) - Custom message bubble. Receives BubbleProps as parameter.renderMessageText(Component | Function) - Custom message textrenderMessageImage(Component | Function) - Custom message image. The built-in one opens the photo viewer on tap: it pages through every photo in the chat, oldest first, with a "3 of 12" counter, the caption, sender and date; pinch or double-tap zooms, and a swipe up or down closes itrenderMessageVideo(Component | Function) - Custom message videorenderMessageAudio(Component | Function) - Custom message audiorenderMessageLocation(Component | Function) - Custom renderer forIMessage.location; defaults to a map card that opens the system maps app on taprenderMessageFile(Component | Function) - Custom renderer forIMessage.file; defaults to a document bubble (a circle with the extension, the name, the size) that opens the file in the share sheet (expo-sharing) or throughLinkingon tapmessageActions(Array | Function(message,defaults)) - Long-press context menu actions. Each item is{ key?, label, icon?, onPress, destructive? }. An array replaces the built-in actions; a function receives the message and the built-in actions for it and returns what to show, so you can extend, filter or reorder them. See Message actions.defaultMessageActions(Bool |MessageActionKey[]) - The built-in actions, in this order:reply,copy,forward,pin,edit,select,delete. Defaulttrue(all that can work); an array picks and orders them;falseturns them off. Each shows only when it can work: Reply whenreply.isEnabledis notfalse; Copy for messages with text whenexpo-clipboardor@react-native-clipboard/clipboardis installed; Edit on your own text messages whenonEditMessageis set; Forward / Pin / Delete when their callbacks are set; Select when a selection can be acted on (a clipboard, Forward or Delete). They are also off whenonLongPressMessageis set andmessageActionsis not, so an app that handles long-press itself keeps doing so.onEditMessage(Function(message,text)) - Turns on the "Edit" action for your own text messages. Edit puts the text in the composer under an "Editing" banner; sending then calls this instead ofonSend. Closing the banner cancels the edit.onDeleteMessage(Function(message)) - Turns on the "Delete" action (not red).onRetryMessage(Function(message)) - Turns on "Retry" for your own messages that failed to send (isFailed), first in their menu above Delete, whateverdefaultMessageActionslists.highlightText(String) /highlightTextStyle(TextStyle) - Words to mark in every message's text, links included (case-insensitive), e.g. the query of a search in the chat; yellow behind black text by default.onForwardMessage(Function(message)) - Turns on the "Forward" action.onForwardMessages(Function(messages)) - Forwards the messages checked in selection mode, oldest first (also turns on "Forward"). Without it the selection bar's Forward callsonForwardMessageonce per message.onDeleteMessages(Function(messages)) - Deletes the messages checked in selection mode, oldest first (also turns on "Delete"). Without it the selection bar's Delete callsonDeleteMessageonce per message.onSelectionChange(Function(messages)) - Multi-select: "Select" in the long-press menu checks the message, a tap checks or unchecks others (check circles on the left, a tinted row), and a bar replaces the composer with the count, Copy (texts joined oldest first), Forward and Delete. Called on every change with the checked messages; with[]once it ends (the X, Android's back, or the last message unchecked).renderSelectionBar(Function({ count, actions, onClose, messages }) | null) - Custom bar in the composer's place while selecting, ornullto keep the composer and drive the selection from your own header throughonSelectionChange.fetchLinkPreview(Function(url) => Promise<LinkPreview| null>) - A web page preview (accent bar, site name, bold title, description, picture full width or as a 48dp thumbnail) is drawn under the text for any message withlinkPreviewdata. For messages without it, this fetches one for the first link in the text, e.g. from your server's Open Graph endpoint; each URL is fetched once per app run.IMessage.linkPreview: nullturns it off for one message.renderLinkPreview(Function({ preview, currentMessage, position, maxWidth, onPress }) | null) - Custom link preview, ornullto draw none. The default is exported asLinkPreviewCard.onPressLinkPreview(Function(preview,message)) - Called when a link preview is tapped, instead of opening its URL.onPinMessage(Function(message)) - Turns on the "Pin" action; it reads "Unpin" on a message withisPinned: true. ToggleisPinnedin the handler.renderCustomView(Component | Function) - Custom view inside the bubbleisCustomViewBottom(Bool) - Determine whether renderCustomView is displayed before or after the text, image and video views; default isfalseonPressMessage(Function(context,message)) - Callback when a message bubble is pressedonLongPressMessage(Function(context,message)) - Callback when a message bubble is long-pressed; you can use this to show action sheets (e.g., copy, delete, reply). Setting it (withoutmessageActions) turns the built-in long-press menu offisMessageGestureEnabled(Bool | Function(message)) - Whether the bubble itself is part of the row's tap / long-press surface thatreactionsandmessageActionsrely on; default istrue. Passfalse, or a predicate, for messages that render natively interactive content - the row beside the bubble stays pressable either way. See Interactive content inside bubbles.imageProps(Object) - Extra props to be passed to the<Image>component created by the defaultrenderMessageImageimageStyle(Object) - Custom style for message imagesvideoProps(Object) - Extra props to be passed to the video component created by the requiredrenderMessageVideomessageTextProps(Object) - Extra props to be passed to the MessageText component. Useful for customizing link parsing behavior, text styles, and matchers:matchers- Custom matchers for linking message content (like URLs, phone numbers, hashtags, mentions)linkStyle- Custom style for linksemail/phone/url- Enable/disable parsing (default: true)hashtag/mention- Enable/disable parsing (default: false)hashtagUrl/mentionUrl- Base URLs (e.g.'https://x.com/hashtag')stripPrefix- Strip 'http://' or 'https://' from URL display (default: false)TextComponent- Custom Text component to use (e.g., from react-native-gesture-handler)
A custom matcher, replacing the default phone linking with an action sheet:
<Chat
messageTextProps={{
phone: false, // Disable default phone number linking
matchers: [
{
type: 'phone',
pattern: /\+?[1-9][0-9\-\(\) ]{7,}[0-9]/g,
getLinkUrl: (replacerArgs: ReplacerArgs): string => {
return replacerArgs[0].replace(/[\-\(\) ]/g, '')
},
getLinkText: (replacerArgs: ReplacerArgs): string => {
return replacerArgs[0]
},
style: styles.linkStyle,
onPress: (match: CustomMatch) => {
const url = match.getAnchorHref()
const options: {
title: string
action?: () => void
}[] = [
{ title: 'Copy', action: () => setStringAsync(url) },
{ title: 'Call', action: () => Linking.openURL(`tel:${url}`) },
{ title: 'Send SMS', action: () => Linking.openURL(`sms:${url}`) },
{ title: 'Cancel' },
]
showActionSheetWithOptions({
options: options.map(o => o.title),
cancelButtonIndex: options.length - 1,
}, (buttonIndex?: number) => {
if (buttonIndex === undefined)
return
const option = options[buttonIndex]
option.action?.()
})
},
},
],
linkStyle: { left: { color: 'blue' }, right: { color: 'lightblue' } },
}}
/>
See the full example in LinksExample.
Avatars, username, date & time, system messages
Avatars
Avatars and sender names show in group chats only: a one-to-one chat has neither.
isGroupChat(Bool) - Whether this is a group chat; default is auto-detected (more than one other sender inmessagesmeans a group)isAvatarVisible(Bool) - Show avatars beside incoming messages; defaulttruein group chats,falsein one-to-one chats, andtruewheneverrenderAvataris a function. Passtrueto keep avatars in one-to-one chatsrenderAvatar(Component | Function) - Custom message avatar; set tonullto not render any avatar for the messageisUserAvatarVisible(Bool) - Whether to render an avatar for the current user; default isfalse, only show avatars for other usersisAvatarVisibleForEveryMessage(Bool) - When false, avatars will only be displayed when a consecutive message is from the same user on the same day; default isfalseonPressAvatar(Function(user)) - Callback when a message avatar is tappedonLongPressAvatar(Function(user)) - Callback when a message avatar is long-pressedisAvatarOnTop(Bool) - Render the message avatar at the top of consecutive messages, rather than the bottom; default isfalse
Username
isUsernameVisible(Bool) - Show the sender's name on the first message of each run of incoming messages; defaulttruein group chats andfalsein one-to-one chats (seeisGroupChat)renderUsername(Component | Function) - Custom Username container
Date & Time
-
timeFormat(String) - Format to use for rendering times; default is'LT'(see Day.js Format) -
dateFormat(String) - Format to use for rendering dates; default is'D MMMM'(see Day.js Format) -
dateFormatCalendar(Object) - Format to use for rendering relative times; default is{ sameDay: '[Today]' }(see Day.js Calendar) -
renderDay(Component | Function) - Custom day above a message. This is also how the day label is styled - it receivesDayProps(createdAt,dateFormat,dateFormatCalendar,containerStyle,wrapperStyle,textProps,isAnimated), so render the built-inDaywith the styles you want:import { Chat, Day, DayProps } from '@kesha-antonov/react-native-chat'<ChatrenderDay={(props: DayProps) => (<Day {...props} wrapperStyle={{ backgroundColor: '#eee' }} textProps={{ style: { color: '#333' } }} />)}/>isAnimatedistruefor the floating header that sticks to the top while scrolling andfalsefor the inline separators, so one function can style them differently. -
renderTime(Component | Function) - Custom time inside a message -
timeTextStyle(Object) - Custom text style for time inside messages (supports left/right styles) -
isDayAnimationEnabled(Bool) - Enable animated day label that appears on scroll; default istrue
System Messages
renderSystemMessage(Component | Function) - Custom system message
Load earlier, typing indicator, quick replies, scroll to bottom
Load Earlier Messages
loadEarlierMessagesProps(Object) - Props to pass to the LoadEarlierMessages component. The button is only visible whenisAvailableistrue:isAvailable- Controls button visibility (default: false)onPress- Callback when button is pressedisLoading- Shows a loading cell, a spinner in a 36 service circle, in place of the button (default: false)isInfiniteScrollEnabled- Enable infinite scroll up when reaching the top of messages container, automatically callsonPress(not yet supported for web). The list then ends in the loading cell instead of a button whileisAvailablelabel- Override the default "Load earlier messages" textcontainerStyle/wrapperStyle/textStyle- Custom styles for the buttonactivityIndicatorStyle- Custom style for the loading indicatoractivityIndicatorColor- Color of the spinner's arc (default: the date pill's text color)activityIndicatorSize- Deprecated and ignored: the spinner is a fixed 28 arc
renderLoadEarlier(Component | Function) - Custom "Load earlier messages" button
Typing Indicator
isTyping(Bool) - Typing Indicator state; defaultfalse. If you userenderFooterit will override this.renderTypingIndicator(Component | Function) - Custom typing indicator componenttypingIndicatorStyle(StyleProp) - Custom style for the TypingIndicator component.renderFooter(Component | Function) - Custom footer component on the ListView, e.g.'User is typing...'; see CustomizedRenderingExample.tsx for an example. Overrides default typing indicator that triggers whenisTypingis true; the indicator comes as the second argument,renderFooter(props, typingIndicator), to keep it next to your own footer.TypingStatus(Component) - The messenger way to show it: in your chat header, three dots that swell in turn before "typing" (waves for a recording, arrows for an upload).<TypingStatus users={typingUsers} action='recordingVoice' isGroup color={accent} />reads "typing", "Anna is typing", "Anna and Max are typing", "recording a voice message"...ChatListrows use it fortypingUsers/typingAction, andgetTypingTextgives the text alone
Quick Replies
See the quick replies example in messages.ts.
onQuickReply(Function) - Callback when sending a quick reply (to backend server)renderQuickReplies(Function) - Custom all quick reply viewquickReplyStyle(StyleProp) - Custom quick reply view stylequickReplyTextStyle(StyleProp) - Custom text style for quick reply buttonsquickReplyContainerStyle(StyleProp) - Custom container style for quick repliesrenderQuickReplySend(Function) - Custom quick reply send view
Scroll to Bottom
The button comes up after you scroll back towards the newest message by scrollToBottomOffset, or when a message arrives while you are away from the newest one, and goes away at the newest message (or after scrolling away again by the same distance, when scrolling brought it up). Messages that arrive while you are away are counted in a badge, which counts down as each one scrolls into view.
isScrollToBottomEnabled(Bool) - Show the scroll-to-bottom button; defaulttrue. Passingtrueexplicitly also keeps the older behaviour of a non-inverted list scrolling to its end on layoutisScrollToBottomBadgeEnabled(Bool) - Count new messages in a badge on the button; defaulttruescrollToBottomComponent(Function) - Custom Scroll To Bottom Component containerscrollToBottomOffset(Integer) - How far to scroll before the button shows or hides; default100scrollToBottomStyle(Object) - Custom style for Scroll To Bottom wrapper (position, bottom, right, etc.)scrollToBottomContentStyle(Object) - Custom style for Scroll To Bottom content (size, background, shadow, etc.)