# MessageInput

`MessageInput` component provides all the UI and necessary functionality (e.g, attachment picker, commands, mentions autocomplete etc.) for composing a message.
This component must be used as child of `Channel` component.

## General Usage

```tsx {11}
import { StreamChat } from "stream-chat";
import {
  Chat,
  Channel,
  MessageList,
  MessageInput,
  OverlayProvider,
} from "stream-chat-react-native";

const client = StreamChat.getInstance("api_key");

export const App = () => (
  <OverlayProvider>
    <Chat client={client}>
      <Channel channel={channel}>
        <MessageList />
        <MessageInput />
      </Channel>
    </Chat>
  </OverlayProvider>
);
```

## Props

<admonition type="note">

All the configuration for `MessageInput` can be done on [`Channel`](/chat/docs/sdk/react-native/v6/core-components/channel/) component.
Additionally please take a look at our [Guide Section](/chat/docs/sdk/react-native/v6/guides/message-input-customization/) on how to customize MessageInput UI

</admonition>

### `asyncMessagesLockDistance`

Controls how many pixels to the top side the user has to scroll in order to lock the recording view and allow the user to lift their finger from the screen without stopping the recording.

| Type   | Default |
| ------ | ------- |
| Number | 50      |


### `asyncMessagesMinimumPressDuration`

Controls the minimum duration(in milliseconds) that the user has to press on the record button in the composer, in order to start recording a new voice message.

| Type   | Default |
| ------ | ------- |
| Number | 500     |


### `AsyncMessagesMultiSendEnabled`

When it’s enabled, recorded messages won’t be sent immediately. Instead they will “stack up” in the composer allowing the user to send multiple voice recording as part of the same message.

| Type    | Default |
| ------- | ------- |
| Boolean | true    |


### `asyncMessagesSlideToCancelDistance`

Controls how many pixels to the leading side the user has to scroll in order to cancel the recording of a voice message.

| Type   | Default |
| ------ | ------- |
| Number | 100     |


### `audioRecordingEnabled`

Controls whether the feature is enabled.

| Type    | Default |
| ------- | ------- |
| Boolean | false   |


### `clearEditingState`

Function to clear "Editing Message" state from MessageInput component.

| Type     |
| -------- |
| Function |


### `clearQuotedMessageState`

Function to clear "Add Quoted Reply" state from MessageInput component.

| Type     |
| -------- |
| Function |


### `closeAttachmentPicker`

Dismiss the attachment picker, if its already open.

| Type     |
| -------- |
| Function |


### `editing`

Defined with message type if the user is editing some message within `MessageInput` component else its undefined.

| Type                    |
| ----------------------- |
| `Message`\| `undefined` |


### `fileUploads`

List of `file` type attachments currently attached to message, which is being composed in `MessageInput` component.

```tsx
[
  {
    file: {
      name: 'test.pdf';
      size: 2000;
      type: 'application/pdf';
      uri: 'file-uri';
    };
    id: 'asdas232bk3jb42k3';
    state: 'uploaded'; // or 'finished'
    url: 'https://cdn.getstream.io/kajsnkj2n3j4';
  }
]
```

| Type  |
| ----- |
| Array |


### `giphyActive`

True if a user selects the `giphy` command from commands list (which is shown when you type a `/` in the input box).
This value is set back to `false` when the user sends the message for searching Giphy.

| Type    |
| ------- |
| Boolean |


### `imageUploads`

List of `image` type attachments currently attached to message, which is being composed in `MessageInput` component.

```tsx
[
  {
    file: { name: "fallback-name.jpeg" },
    id: "2j3n4k23nj4k23n4k3",
    state: "finished", // or 'uploading'
    url: "https://cdn.getstream.io/kajsnkj2n3j4", // If the state is `uploading`, then this will be a local uri of image.
  },
];
```

| Type  |
| ----- |
| Array |


### `inputBoxRef`

Ref for [`TextInput`](https://reactnative.dev/docs/textinput) component within `MessageInput`

| Type                                                                                      |
| ----------------------------------------------------------------------------------------- |
| [React ref](https://reactjs.org/docs/refs-and-the-dom.html#adding-a-ref-to-a-dom-element) |


### `isValidMessage`

False if text within input box is empty and no images or files have been attached to a message yet. You can use this value to add enabled/disabled UI state on SendMessage button.

| Type    |
| ------- |
| Boolean |


### `members`

Members of current channel. This value is received from backend when you query a channel, either using [`client.queryChannels()`](/chat/docs/javascript/query_channels/) or [`channel.watch()`](/chat/docs/javascript/creating_channels/) API call.

<admonition type="warning">

`client.queryChannels()` or `channel.watch()` returns only up to 100 members of channel. So if you expect total number of members to be > 100, its better to use [`client.queryMembers()`](/chat/docs/javascript/query_members/) API endpoint separately to get the list of members.

</admonition>

```tsx
Record<
  string, // userId
  {
    banned?: boolean;
    created_at?: string;
    invite_accepted_at?: string;
    invite_rejected_at?: string;
    invited?: boolean;
    is_moderator?: boolean;
    role?: string;
    shadow_banned?: boolean;
    updated_at?: string;
    user?: UserResponse<UserType>;
    user_id?: string;
  }
>;
```

| Type   |
| ------ |
| object |


### `suggestions`

Current active list of suggestions, within suggestions list for autocomplete feature.

| Type                                                             |
| ---------------------------------------------------------------- |
| `{ data: array<object>, onSelect: function, queryText: string }` |


### `suggestionsTitle`

Title component of current active suggestions autocomplete list.

| Type              |
| ----------------- |
| string \| Element |


### `additionalTextInputProps`

Additional props provided to the underlying [TextInput](https://reactnative.dev/docs/textinput#props) within [`MessageInput`](/chat/docs/sdk/react-native/v6/ui-components/message-input/).

| Type   |
| ------ |
| object |


### `asyncIds`

Queue that stores the asset id, if user hit send before image uploaded.

| Type       |
| ---------- |
| `String[]` |


### `asyncUploads`

It is of type Object with key as the asynchronous upload id, and value as an object containing file upload state and URL(`url`).

| Type   |
| ------ |
| Object |


### `maxNumberOfFiles`

Maximum number of files (documents & images), that can be attached per message.

| Type   | Default |
| ------ | ------- |
| number | 10      |


### `mentionedUsers`

Ids of users which are mentioned (for example `Hey @Vishal Narkhede, how are you`) in a message, which is being composed in MessageInput component.

```tsx
["vishal-user-id", "jaap-user-id"];
```

| Type     |
| -------- |
| String[] |


### `numberOfUploads`

Number of image + files attached to message which is being composed in `MessageInput` component.

| Type   |
| ------ |
| Number |


### `quotedMessage`

Message that is quoted to the original message

| Type                    |
| ----------------------- |
| `Message`\| `undefined` |


### `removeImage`

Removes an attached image in a message being composed in the `MessageInput` component. By default, this function is attached to `onPress` handler for close button in [ImageUploadPreview](/chat/docs/sdk/react-native/v6/core-components/channel#imageuploadpreview/).
It takes a string ID of the image to be removed in the [`imageUploads`](/chat/docs/sdk/react-native/v6/contexts/message-input-context#imageuploads/) array as parameter.

| Type                   |
| ---------------------- |
| `(id: string) => void` |


### `resetInput`

Resets the entire `MessageInput` component to empty state by clearing the text, attachments etc.

| Type     |
| -------- |
| Function |


### `sending`

Indicates whether a message is currently being sent.

| Type    |
| ------- |
| boolean |

### `sendMessageAsync`



### `setGiphyActive`

Setter function for [`giphyActive`](/chat/docs/sdk/react-native/v6/contexts/message-input-context#giphyactive/)

| Type                 |
| -------------------- |
| `(isActive) => void` |


### `showMoreOptions`

Represents the expanded or collapsed state for attach and commands button, next to input box.

| Type    |
| ------- |
| Boolean |


### `thread`

Can be either a `MessageType` object or a [`ThreadType`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/contexts/threadContext/ThreadContext.tsx) that when set indicates a thread is open.
Both of the types may be used interchangeably.

When used with the [`Thread`](/chat/docs/sdk/react-native/v6/ui-components/thread/) component this will display the thread.
When used with the standard [`MessageList`](/chat/docs/sdk/react-native/v6/ui-components/message-list/) component this will prevent any singleton components in the [`OverlayProvider`](/chat/docs/sdk/react-native/v6/core-components/overlay-provider/) form getting out of sync.

<admonition type="note">

`thread` should be set on all `Channel` components when a thread is open.

</admonition>

| Type   |
| ------ |
| object |


### `uploadNewImage`

Function to upload an attached image in `MessageInput`. This function takes a image from `imageUploads` array as a parameter.

| Type                 |
| -------------------- |
| `(image) => Promise` |


### `watchers`

Watchers of current channel. This value is received from backend when you query a channel, either using [`client.queryChannels()`](/chat/docs/javascript/query_channels/) or [`channel.watch()`](/chat/docs/javascript/creating_channels/) API call.

<admonition type="warning">

`client.queryChannels()` or `channel.watch()` returns only up to 100 watchers for channel. So if you expect total number of watchers to be > 100, you should request them explicitly using [Channel Pagination](/chat/docs/javascript/channel_pagination/)

</admonition>

```tsx
Record<
  string, // string
  UserResponse<UserType>
>;
```

| Type   |
| ------ |
| object |


### `triggerType`

The trigger type triggers a particular type of autocomplete list depending on user input.

| Type                              |
| --------------------------------- |
| 'command' \| 'emoji' \| 'mention' |


## UI Component Props

### `AudioRecorder`

Custom UI component to render audio recorder controls in [MessageInput](/chat/docs/sdk/react-native/v6/ui-components/message-input/).

| Type          | Default                                                                                                                                  |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`AudioRecorder`](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/AudioRecorder.tsx) |


### `AudioRecordingInProgress`

Custom UI component to render audio recording in progress in [MessageInput](/chat/docs/sdk/react-native/v6/ui-components/message-input/). It renders the waveform, duration etc, for the recording.

| Type          | Default                                                                                                                                                                                 |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`AudioRecordingInProgress`](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.tsx) |


### `AudioRecordingLockIndicator`

Custom UI component to render audio recording lock indicator in [MessageInput](/chat/docs/sdk/react-native/v6/ui-components/message-input/) that can be dragged up to lock the recording start.

| Type          | Default                                                                                                                                                                                       |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`AudioRecordingLockIndicator`](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator.tsx) |


### `AudioRecordingPreview`

Custom UI component to render audio recording preview in [MessageInput](/chat/docs/sdk/react-native/v6/ui-components/message-input/) that allows playing the recording.

| Type          | Default                                                                                                                                                                           |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`AudioRecordingPreview`](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.tsx) |


### `AudioRecordingWaveform`

Custom UI component to render audio recording waveform in [MessageInput](/chat/docs/sdk/react-native/v6/ui-components/message-input/).

| Type          | Default                                                                                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`AudioRecordingWaveform`](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingWaveform.tsx) |


### `Reply`

Component to render preview of parent of message for quoted reply.

| Type          | Default                                                                                                              |
| ------------- | -------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`Reply`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/components/Reply/Reply.tsx) |


### `FileUploadPreview`

Component to render preview of attached file, within enclosed `MessageInput` component.

| Type          | Default                                                                                                                                             |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`FileUploadPreview`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/components/MessageInput/FileUploadPreview.tsx) |


### `ImageUploadPreview`

Component to render preview of attached images, within enclosed MessageInput component

| Type          | Default                                                                                                                                               |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`ImageUploadPreview`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/components/MessageInput/ImageUploadPreview.tsx) |


### `Input`

Component to render UI part of enclosed MessageInput component.
Please read section in guides about [Customizing Message Input](/chat/docs/sdk/react-native/v6/guides/message-input-customization/).

| Type          |
| ------------- |
| ComponentType |


### `InputButtons`

Component to render action buttons (CommandsButton and AttachButton) on left side of input box, within enclosed `MessageInput` component.

| Type          | Default                                                                                                                                   |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`InputButtons`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/components/MessageInput/InputButtons.tsx) |


### `SendButton`

Component to render a send message button, within enclosed MessageInput component.

| Type          | Default                                                                                                                               |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`SendButton`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/components/MessageInput/SendButton.tsx) |


### `ShowThreadMessageInChannelButton`

Component to render a checkbox within enclosed Thread component, which when checked sets a `show_in_channel` property to true on a message.

| Type          | Default                                                                                                                                                                           |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [`ShowThreadMessageInChannelButton`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx) |


### `StartAudioRecordingButton`

Custom UI component for audio recording mic button in [MessageInput](/chat/docs/sdk/react-native/v6/ui-components/message-input/).

| Type          | Default                                                                                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ComponentType | [`StartAudioRecordingButton`](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingButton.tsx) |



---

This page was last updated at 2026-04-22T14:09:37.783Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/v6/ui-components/message-input/](https://getstream.io/chat/docs/sdk/react-native/v6/ui-components/message-input/).