import { WithComponents, FileIcon } from "stream-chat-react-native";
<WithComponents
overrides={{ FileAttachmentIcon: () => <FileIcon size={40} /> }}
>
<Channel channel={channel}>
<MessageList />
<MessageComposer />
</Channel>
</WithComponents>;FileIcon
Renders the file attachment icon inside MessageList.
Best Practices
- Use
mimeTypeto select appropriate icons or colors. - Keep icon sizes consistent across file attachments.
- Avoid heavy icon rendering logic in large lists.
- Provide a fallback icon for unknown MIME types.
- Customize via
WithComponentsto keep overrides centralized.
Basic Usage
Replace the default UI via WithComponents.
Example: change the icon size.
Props
| Prop | Description | Type |
|---|---|---|
mimeType | MIME type for the file attachment (for example, application/pdf, audio/mp4). | string |
size | Icon size. | number |