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 WithComponents instead of editing internals.

Basic Usage

Replace the default UI via WithComponents.

Example: change the file attachment icon size.

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

<WithComponents
  overrides={{ FileAttachment: () => <FileAttachment attachmentSize={40} /> }}
>
  <Channel channel={channel}>
    <MessageList />
    <MessageComposer />
  </Channel>
</WithComponents>;

Props

PropDescriptionType
attachmentAttachment object for a file type attachment.object
attachmentSizeAttachment icon size, passed to FileAttachmentIcon.number
additionalPressablePropsExtra props passed to the underlying Pressable used in message components like MessageContent.object

UI Component Props

PropDescriptionType
AttachmentActionsRenders additional attachment actions (for example, Giphy send/shuffle/cancel). Defaults to AttachmentActions.ComponentType
FileAttachmentIconRenders the file icon for file attachments. Defaults to FileIcon.ComponentType