import { WithComponents, FileAttachment } from "stream-chat-react-native";
<WithComponents
overrides={{ FileAttachment: () => <FileAttachment attachmentSize={40} /> }}
>
<Channel channel={channel}>
<MessageList />
<MessageComposer />
</Channel>
</WithComponents>;FileAttachment
Renders file attachments inside MessageList.
Best Practices
- Keep file rows compact and readable.
- Use
AttachmentActionsfor 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
WithComponentsinstead of editing internals.
Basic Usage
Replace the default UI via WithComponents.
Example: change the file attachment icon size.
Props
| Prop | Description | Type |
|---|---|---|
attachment | Attachment object for a file type attachment. | object |
attachmentSize | Attachment icon size, passed to FileAttachmentIcon. | number |
additionalPressableProps | Extra props passed to the underlying Pressable used in message components like MessageContent. | object |
UI Component Props
| Prop | Description | Type |
|---|---|---|
AttachmentActions | Renders additional attachment actions (for example, Giphy send/shuffle/cancel). Defaults to AttachmentActions. | ComponentType |
FileAttachmentIcon | Renders the file icon for file attachments. Defaults to FileIcon. | ComponentType |