URLPreview

URLPreview renders rich link previews for message attachments. This is the default component for the UrlPreview prop.

Best Practices

  • Use rich previews when link context is important.
  • Keep preview text concise for better truncation.
  • Reuse default safe URL opening behavior in custom handlers.
  • Keep custom styles additive to preserve spacing and hit targets.
  • Use compact mode (URLPreviewCompact) when you need denser message rows.

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
isAttachmentEqualCustom equality check used for attachment memoization.function
stylesStyle overrides for URL preview internals (container, cardCover, cardFooter, title, description, linkPreview, linkPreviewText).object

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