import { Channel, FileAttachment } from "stream-chat-react-native";
<Channel FileAttachment={() => <FileAttachment attachmentSize={40} />} />;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 the
Channelprop instead of editing internals.
Basic Usage
Customize it and pass it via the FileAttachment prop on Channel.
Example: change the file attachment icon size.
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).
| Type | Default |
|---|---|
| ComponentType | AttachmentActions |
FileAttachmentIcon
Renders the file icon for file attachments.
| Type | Default |
|---|---|
| ComponentType | FileIcon |