This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8)
.
Attachment
Renders message attachments inside MessageList. This is the default component for the Attachment prop.
It selects the correct renderer by attachment type (card, Giphy, file, etc.). For customization, use type-specific props like Giphy, Gallery, UrlPreview, or FileAttachment. See Attachment Customization for details.
Best Practices
- Prefer type-specific overrides (Gallery, FileAttachment) over replacing the whole Attachment component.
- Handle unknown or custom attachment types gracefully.
- Keep attachment rendering lightweight to avoid list jank.
- Use
AttachmentActionsfor supported actions instead of custom tap logic. - Ensure URL previews and media rendering are consistent with your app theme.
Props
attachment
Attachment object to render. Typically an item from message.attachments (for example, message.attachments[0]).
| Type |
|---|
| object |
UI Component Props
AttachmentActions
Renders additional attachment actions (for example, Giphy send/shuffle/cancel).
| Type | Default |
|---|---|
| ComponentType | AttachmentActions |
FileAttachment
Renders file attachments in MessageList.
| Type | Default |
|---|---|
| ComponentType | FileAttachment |
Gallery
Renders image attachments in MessageList.
| Type | Default |
|---|---|
| ComponentType | Gallery |
Giphy
Renders Giphy attachments in MessageList.
| Type | Default |
|---|---|
| ComponentType | Giphy |
UrlPreview
Renders URL previews in MessageList.
| Type | Default |
|---|---|
| ComponentType | UrlPreview |
URLPreviewCompact
Renders compact URL previews in MessageList.
| Type | Default |
|---|---|
| ComponentType | URLPreviewCompact |
urlPreviewType
Type of URL preview to render.
| Type | Default |
|---|---|
full | compact | full |