URLPreviewCompact

URLPreviewCompact renders compact link previews for attachments when urlPreviewType="compact".

Best Practices

  • Use compact previews when message density is more important than rich previews.
  • Keep custom styles additive to preserve card layout and tap targets.
  • Use default press handlers for safe URL opening.
  • Provide a fallback when image URLs are missing.
  • Keep title/description text short for better truncation.

Props

PropDescriptionType
attachmentAttachment object used for preview content.object
additionalPressablePropsExtra props passed to the underlying Pressable used in message components like MessageContent.object
onLongPressDefault long press handler for message UI.function
onPressDefault press handler for message UI.function
onPressInDefault pressIn handler for message UI.function
preventPressDisable press interactions.boolean
stylesStyle overrides for compact preview internals (container, cardCover, cardFooter, title, description, linkPreview, linkPreviewText).object

ImageComponent is provided through WithComponents and read internally via useComponentsContext().