This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8) .

FilePreview

FilePreview renders the file icon, title, and metadata used by FileAttachment.

Best Practices

  • Use this component to keep file rows visually consistent.
  • Keep title lines constrained for dense message layouts.
  • Prefer indicator overrides for lightweight status UI.
  • Reuse FileAttachmentIcon overrides from Channel for consistency.
  • Keep custom styles additive to preserve spacing and truncation behavior.

Props

attachment

Attachment object to preview.

Type
object

attachmentIconSize

Icon size passed to the file icon component.

Type
'sm' | 'md' | 'lg'

titleNumberOfLines

Maximum number of lines for the file title.

TypeDefault
number2

indicator

Custom metadata indicator replacing default size/duration text.

Type
ReactNode

styles

Style overrides (container, details, size, title).

Type
object

UI Component Props

FileAttachmentIcon

Icon component used for file previews.

Renders the file icon for file attachments.

TypeDefault
ComponentTypeFileIcon