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

PropDescriptionType
attachmentAttachment object to preview.object
attachmentIconSizeIcon size passed to the file icon component.'sm' | 'md' | 'lg'
titleNumberOfLinesMaximum number of lines for the file title. Defaults to 2.number
indicatorCustom metadata indicator replacing default size/duration text. Used by FileAttachment to show pending upload progress.ReactNode
stylesStyle overrides (container, details, size, title).object

UI Component Props

FileAttachmentIcon

Icon component used for file previews.

Renders the file icon for file attachments.

TypeDefault
ComponentTypeFileIcon