Need help with react-native-gifted-chat?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

11.1K Stars 3.1K Forks MIT License 1.2K Commits 88 Opened issues


💬 The most complete chat UI for React Native

Services available


Need anything else?

Contributors list


💬 Gifted Chat

The most complete chat UI for React Native & Web

npm downloads npm version

 build  deployed

Demo Web 🖥

Snack GiftedChat playground


Coding Bootcamp in Paris co-founded by Farid Safi

Click to learn more

Scalable chat API/Server written in Go

API Tour | React Native Gifted tutorial

Delivering Personalized Healthcare

Find out more

The future of GiftedChat 🎉

Please give us your advice: Related PR

Please vote

GiftedChat depends on other packages and some needs a boost, please vote for PRs will improve it, thanks: -


  • 🎉
    (since 0.10.0)
    web configuration
  • Write with TypeScript (since 0.8.0)
  • Fully customizable components
  • Composer actions (to attach photos, etc.)
  • Load earlier messages
  • Copy messages to clipboard
  • Touchable links using react-native-parsed-text
  • Avatar as user's initials
  • Localized dates
  • Multi-line TextInput
  • InputToolbar avoiding keyboard
  • Redux support
  • System message
  • Quick Reply messages (bot)
  • Typying indicatior react-native-typing-animation


  • Use version
    for RN
    >= 0.44.0
  • Use version
    for RN
    >= 0.40.0
  • Use version
    for RN
    < 0.40.0


  • Using npm:
    npm install react-native-gifted-chat --save
  • Using Yarn:
    yarn add react-native-gifted-chat

react-native-video and expo-av

  • Both dependencies are removed since
  • You still be able to provide a
    but you need to provide

You have a question?

  1. Please check this readme and may find a response
  2. Please ask on StackOverflow first:
  3. Find response on existing issues
  4. Try to keep issues for issues


import React, { useState, useCallback, useEffect } from 'react'
import { GiftedChat } from 'react-native-gifted-chat'

export function Example() { const [messages, setMessages] = useState([]);

useEffect(() => { setMessages([ { _id: 1, text: 'Hello developer', createdAt: new Date(), user: { _id: 2, name: 'React Native', avatar: '', }, }, ]) }, [])

const onSend = useCallback((messages = []) => { setMessages(previousMessages => GiftedChat.append(previousMessages, messages)) }, [])

return ( onSend(messages)} user={{ _id: 1, }} /> ) }

Advanced example


for a working demo!

"Slack" example

See the files in

for an example of how to override the default UI to make something that looks more like Slack -- with usernames displayed and all messages on the left.

Message object

e.g. Chat Message

export interface IMessage {
  _id: string | number
  text: string
  createdAt: Date | number
  user: User
  image?: string
  video?: string
  audio?: string
  system?: boolean
  sent?: boolean
  received?: boolean
  pending?: boolean
  quickReplies?: QuickReplies
  _id: 1,
  text: 'My message',
  createdAt: new Date(Date.UTC(2016, 5, 11, 17, 20, 0)),
  user: {
    _id: 2,
    name: 'React Native',
    avatar: '',
  image: '',
  // You can also add a video prop:
  video: '',
  // Mark the message as sent, using one tick
  sent: true,
  // Mark the message as received, using two tick
  received: true,
  // Mark the message as pending with a clock loader
  pending: true,
  // Any additional custom parameters are passed through

e.g. System Message

  _id: 1,
  text: 'This is a system message',
  createdAt: new Date(Date.UTC(2016, 5, 11, 17, 20, 0)),
  system: true,
  // Any additional custom parameters are passed through

e.g. Chat Message with Quick Reply options

See PR #1211

interface Reply {
  title: string
  value: string
  messageId?: any

interface QuickReplies { type: 'radio' | 'checkbox' values: Reply[] keepIt?: boolean }

    _id: 1,
    text: 'This is a quick reply. Do you love Gifted Chat? (radio) KEEP IT',
    createdAt: new Date(),
    quickReplies: {
      type: 'radio', // or 'checkbox',
      keepIt: true,
      values: [
          title: '😋 Yes',
          value: 'yes',
          title: '📷 Yes, let me show you with a picture!',
          value: 'yes_picture',
          title: '😞 Nope. What?',
          value: 'no',
    user: {
      _id: 2,
      name: 'React Native',
    _id: 2,
    text: 'This is a quick reply. Do you love Gifted Chat? (checkbox)',
    createdAt: new Date(),
    quickReplies: {
      type: 'checkbox', // or 'radio',
      values: [
          title: 'Yes',
          value: 'yes',
          title: 'Yes, let me show you with a picture!',
          value: 'yes_picture',
          title: 'Nope. What?',
          value: 'no',
    user: {
      _id: 2,
      name: 'React Native',


  • messages
    (Array) - Messages to display
  • isTyping
    (Bool) - Typing Indicator state; default
    . If you use
    it will override this.
  • text
    (String) - Input text; default is
    , but if specified, it will override GiftedChat's internal state (e.g. for redux; see notes below)
  • placeholder
    (String) - Placeholder when
    is empty; default is
    'Type a message...'
  • messageIdGenerator
    (Function) - Generate an id for new messages. Defaults to UUID v4, generated by uuid
  • user
    (Object) - User sending the messages:
    { _id, name, avatar }
  • onSend
    (Function) - Callback when sending a message
  • alwaysShowSend
    (Bool) - Always show send button in input text composer; default
    , show only when text input is not empty
  • locale
    (String) - Locale to localize the dates. You need first to import the locale you need (ie.
    import 'dayjs/locale/fr'
  • timeFormat
    (String) - Format to use for rendering times; default is
  • dateFormat
    (String) - Format to use for rendering dates; default is
  • loadEarlier
    (Bool) - Enables the "load earlier messages" button, required for
  • isKeyboardInternallyHandled
    (Bool) - Determine whether to handle keyboard awareness inside the plugin. If you have your own keyboard handling outside the plugin set this to false; default is
  • onLoadEarlier
    (Function) - Callback when loading earlier messages
  • isLoadingEarlier
    (Bool) - Display an
    when loading earlier messages
  • renderLoading
    (Function) - Render a loading view when initializing
  • renderLoadEarlier
    (Function) - Custom "Load earlier messages" button
  • renderAvatar
    (Function) - Custom message avatar; set to
    to not render any avatar for the message
  • showUserAvatar
    (Bool) - Whether to render an avatar for the current user; default is
    , only show avatars for other users
  • showAvatarForEveryMessage
    (Bool) - When false, avatars will only be displayed when a consecutive message is from the same user on the same day; default is
  • onPressAvatar
    - Callback when a message avatar is tapped
  • onLongPressAvatar
    - Callback when a message avatar is long-pressed
  • renderAvatarOnTop
    (Bool) - Render the message avatar at the top of consecutive messages, rather than the bottom; default is
  • renderBubble
    (Function) - Custom message bubble
  • renderTicks
    - Custom ticks indicator to display message status
  • renderSystemMessage
    (Function) - Custom system message
  • onPress
    - Callback when a message bubble is pressed
  • onLongPress
    - Callback when a message bubble is long-pressed; default is to show an ActionSheet with "Copy Text" (see example using
  • inverted
    (Bool) - Reverses display order of
    ; default is
  • renderUsernameOnMessage
    (Bool) - Indicate whether to show the user's username inside the message bubble; default is
  • renderMessage
    (Function) - Custom message container
  • renderMessageText
    (Function) - Custom message text
  • renderMessageImage
    (Function) - Custom message image
  • renderMessageVideo
    (Function) - Custom message video
  • imageProps
    (Object) - Extra props to be passed to the
    component created by the default
  • videoProps
    (Object) - Extra props to be passed to the video component created by the required
  • lightboxProps
    (Object) - Extra props to be passed to the
    's Lightbox
  • isCustomViewBottom
    (Bool) - Determine whether renderCustomView is displayed before or after the text, image and video views; default is
  • renderCustomView
    (Function) - Custom view inside the bubble
  • renderDay
    (Function) - Custom day above a message
  • renderTime
    (Function) - Custom time inside a message
  • renderFooter
    (Function) - Custom footer component on the ListView, e.g.
    'User is typing...'
    ; see App.tsx for an example. Overrides default typing indicator that triggers when
    is true.
  • renderChatEmpty
    (Function) - Custom component to render in the ListView when messages are empty
  • renderChatFooter
    (Function) - Custom component to render below the MessageContainer (separate from the ListView)
  • renderInputToolbar
    (Function) - Custom message composer container
  • renderComposer
    (Function) - Custom text input message composer
  • renderActions
    (Function) - Custom action button on the left of the message composer
  • renderSend
    (Function) - Custom send button; you can pass children to the original
    component quite easily, for example, to use a custom icon (example)
  • renderAccessory
    (Function) - Custom second line of actions below the message composer
  • onPressActionButton
    (Function) - Callback when the Action button is pressed (if set, the default
    will not be used)
  • bottomOffset
    (Integer) - Distance of the chat from the bottom of the screen (e.g. useful if you display a tab bar)
  • minInputToolbarHeight
    (Integer) - Minimum height of the input toolbar; default is
  • listViewProps
    (Object) - Extra props to be passed to the messages
    ; some props can't be overridden, see the code in
    for details
  • textInputProps
    (Object) - Extra props to be passed to the
  • textInputStyle
    (Object) - Custom style to be passed to the
  • multiline
    (Bool) - Indicates whether to allow the
    to be multiple lines or not; default
  • keyboardShouldPersistTaps
    (Enum) - Determines whether the keyboard should stay visible after a tap; see
  • onInputTextChanged
    (Function) - Callback when the input text changes
  • maxInputLength
    (Integer) - Max message composer TextInput length
  • parsePatterns
    (Function) - Custom parse patterns for react-native-parsed-text used to linking message content (like URLs and phone numbers), e.g.:
     { type: 'phone', style: linkStyle, onPress: this.onPressPhoneNumber },
     { pattern: /#(\w+)/, style: { ...linkStyle, styles.hashtag }, onPress: this.onPressHashtag },
  • extraData
    (Object) - Extra props for re-rendering FlatList on demand. This will be useful for rendering footer etc.
  • minComposerHeight
    (Object) - Custom min-height of the composer.
  • maxComposerHeight
    (Object) - Custom max height of the composer.

  • scrollToBottom
    (Bool) - Enables the scroll to bottom Component (Default is false)

  • scrollToBottomComponent
    (Function) - Custom Scroll To Bottom Component container

  • scrollToBottomOffset
    (Integer) - Custom Height Offset upon which to begin showing Scroll To Bottom Component (Default is 200)

  • scrollToBottomStyle
    (Object) - Custom style for Bottom Component container

  • alignTop
    (Boolean) Controls whether or not the message bubbles appear at the top of the chat (Default is false - bubbles align to bottom)

  • onQuickReply
    (Function) - Callback when sending a quick reply (to backend server)

  • renderQuickReplies
    (Function) - Custom all quick reply view

  • quickReplyStyle
    (StyleProp) - Custom quick reply view style

  • renderQuickReplySend
    (Function) - Custom quick reply send view

  • shouldUpdateMessage
    (Function) - Lets the message component know when to update outside of normal cases.

  • infiniteScroll
    (Bool) - infinite scroll up when reach the top of messages container, automatically call onLoadEarlier function if exist (not yet supported for the web). You need to add

    prop too.

Imperative methods

  • focusTextInput()
    - Open the keyboard and focus the text input box

Notes for Redux


prop should work out-of-the-box with Redux. In most cases, this is all you need.

If you decide to specify a

prop, GiftedChat will no longer manage its own internal
state and will defer entirely to your prop. This is great for using a tool like Redux, but there's one extra step you'll need to take: simply implement
to receive typing events and reset events (e.g. to clear the text
  /* ... */

Notes for Android

If you are using Create React Native App / Expo, no Android specific installation steps are required -- you can skip this section. Otherwise, we recommend modifying your project configuration as follows.

  • Make sure you have
    in your
  • For Expo, there are at least 2 solutions to fix it:

    • Append
      after GiftedChat. This should only be done for Android, as
      may conflict with the iOS keyboard avoidance already built into GiftedChat, e.g.:
      Platform.OS === 'android' && 

If you use React Navigation, additional handling may be required to account for navigation headers and tabs.

property can be set to the height of the navigation header and
can be set to keep the tab bar from being shown when the keyboard is up. Due to a bug with calculating height on Android phones with notches,
is recommended over other solutions that involve calculating the height of the window.
  • adding an opaque background status bar on app.json (even though

    is set internally on Expo's Android apps, the translucent status bar causes it not to work):
  • If you plan to use

    inside a
    , see #200.

Notes for local development


  1. Install
    yarn global add expo-cli
  2. Install dependencies
    yarn install
  3. expo start


With expo

  1. Install
    yarn global add expo-cli
  2. Install dependencies
    yarn install
  3. expo start -w

Upgrade snack version

With create-react-app

  1. yarn add -D react-app-rewired
  2. touch config-overrides.js
module.exports = function override(config, env) {
    test: /\.js$/,
    exclude: /node_modules[/\\](?!react-native-gifted-chat|react-native-lightbox|react-native-parsed-text)/,
    use: {
      loader: 'babel-loader',
      options: {
        babelrc: false,
        configFile: false,
        presets: [
          ['@babel/preset-env', { useBuiltIns: 'usage' }],
        plugins: ['@babel/plugin-proposal-class-properties'],

return config }

You will find an example and a web demo here: xcarpentier/gifted-chat-web-demo

Another example with Gatsby : xcarpentier/clean-archi-boilerplate




Feel free to ask me questions on Twitter @FaridSafi! or @xcapetir!


Hire an expert!

Looking for a ReactNative freelance expert with more than 14 years of experience? Contact Xavier from his website!

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.