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). Deep-merged overdefaultLightTheme; any subset is allowed. See Theming & Dark Mode.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(FlatList ref) - Ref to the flatlisttextInputRef(TextInput ref) - Ref to the text input
Keyboard & layout
Keyboard & Layout
-
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; ignored whenisFlashListEnabledis set, since FlashList positions its own items. -
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 fieldisSendButtonAlwaysVisible(Bool) - Always show send button in input text composer; defaultfalse, show only when text input is not emptyisTextOptional(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 composeronPressEmoji(Function) - Callback for the optional emoji button on the left of the composer field. When omitted, the emoji button is hidden.audioRecording(Object) - Enable Telegram-style hold-to-record voice notes.{ isEnabled, minDurationMs?, onError? }. Requires the optionalexpo-audiopeer (andreact-native-audio-apifor the playback waveform); the mic button is hidden when it is absent.videoRecording(Object) - Enable record-and-send video messages.{ isEnabled, maxDuration?, onError? }. Usesreact-native-vision-camerafor round camera notes, falling back toexpo-image-picker's system camera.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
actions(Array) - Action options for the composer "+" button. Array of{ title, action }; addicon(and optionalcolor) to an action to render a Telegram-style 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 when initializingrenderChatEmpty(Component | Function) - Custom component to render in the ListView when messages are emptyrenderChatFooter(Component | Function) - Custom component to render below the MessagesContainer (separate from the ListView)listProps(Object) - Extra props to be passed to the messages<FlatList>. Supports all FlatList props includingmaintainVisibleContentPositionfor keeping scroll position when new messages arrive (useful for AI chatbots).isFlashListEnabled(Bool) - Render messages with@shopify/flash-listv2 instead ofFlatList; default isfalse. See FlashList.
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 imagerenderMessageVideo(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 tapmessageActions(Array | Function(message)) - Telegram-style long-press context menu. Each item is{ label, icon?, onPress, destructive? }. See Message actions.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)isMessageGestureEnabled(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
renderAvatar(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) - Indicate whether to show the user's username inside the message bubble; default isfalserenderUsername(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- Display loading indicator (default: false)isInfiniteScrollEnabled- Enable infinite scroll up when reaching the top of messages container, automatically callsonPress(not yet supported for web)label- Override the default "Load earlier messages" textcontainerStyle/wrapperStyle/textStyle- Custom styles for the buttonactivityIndicatorStyle- Custom style for the loading indicatoractivityIndicatorColor- Color of the loading indicator (default: 'white')activityIndicatorSize- Size of the loading indicator (default: 'small')
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.
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
isScrollToBottomEnabled(Bool) - Enables the scroll to bottom Component (Default is false)scrollToBottomComponent(Function) - Custom Scroll To Bottom Component containerscrollToBottomOffset(Integer) - Custom Height Offset upon which to begin showing Scroll To Bottom Component (Default is 200)scrollToBottomStyle(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.)