FileAttachment

Renders file attachments inside MessageList.

Best Practices

  • Keep file rows compact and readable.
  • Use AttachmentActions for consistent send/shuffle/cancel behaviors where applicable.
  • Validate file size/type before rendering heavy previews.
  • Use consistent icons and sizes across your app.
  • Customize via the Channel prop instead of editing internals.

Basic Usage

Customize it and pass it via the FileAttachment prop on Channel.

Example: change the file attachment icon size.

import { Channel, FileAttachment } from "stream-chat-react-native";

<Channel FileAttachment={() => <FileAttachment attachmentSize={40} />} />;

Props

attachment

Attachment object for a file type attachment.

Type
Object

attachmentSize

Attachment icon size, passed to FileAttachmentIcon.

Type
Number

additionalPressableProps

Extra props passed to the underlying Pressable used in message components like MessageContent.

Type
object

UI Component Props

AttachmentActions

Renders additional attachment actions (for example, Giphy send/shuffle/cancel).

TypeDefault
ComponentTypeAttachmentActions

FileAttachmentIcon

Renders the file icon for file attachments.

TypeDefault
ComponentTypeFileIcon