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

Prop Description Type
attachment Attachment object to preview. object
attachmentIconSize Icon size passed to the file icon component. 'sm' | 'md' | 'lg'
titleNumberOfLines Maximum number of lines for the file title. Defaults to 2. number
indicator Custom metadata indicator replacing default size/duration text. Used by FileAttachment to show pending upload progress. ReactNode
styles Style overrides (container, details, size, title). object

UI Component Props

FileAttachmentIcon

Icon component used for file previews.

Renders the file icon for file attachments.

Type Default
ComponentType FileIcon
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React Native v9: <Your Question>