Skip to content

Releases: azizbecha/react-native-preview-url

v0.1.0

10 Aug 19:28

Choose a tag to compare

🎉 v1.0.0 — First Public Release

We’re excited to announce the first public release of react-native-preview-url 🚀 — a React Native library for displaying rich link previews using our free open-source Link Preview API.

✨ Features

<LinkPreview /> Component — display link previews with customizable styles and layout.

useUrlPreview Hook — fetch and manage preview metadata easily in functional components.

Customizable UI with style overrides and behavior props.

Free API usage — no API key required.

📋 Props

This release supports the following props for <LinkPreview />:

url (string, required) — The URL to preview.

timeout (number) — Request timeout in milliseconds, default is 3000.

onSuccess (function) — Callback when metadata is fetched successfully. Receives the metadata object.

onError (function) — Callback when an error occurs. Receives the error message.

onPress (function) — Press handler for the whole preview. Defaults to opening the fetched data.url.

containerStyle (ViewStyle) — Custom style for the main container.

imageStyle (ImageStyle) — Custom style for the preview image.

imageContainerStyle (ViewStyle) — Custom style for the image wrapper.

titleStyle (TextStyle) — Custom style for the title text.

descriptionStyle (TextStyle) — Custom style for the description text.

urlStyle (TextStyle) — Custom style for the displayed domain text.

titleLines (number) — Maximum number of lines for the title. Default: 2.

descriptionLines (number) — Maximum number of lines for the description. Default: 4.

showUrl (boolean) — Whether to display the domain under the description. Default: true.

hideImage (boolean) — Whether to hide the image preview entirely. Default: false.

loaderComponent (JSX element) — Custom loader component while fetching metadata. Defaults to .

imageComponent (React component) — Custom image component to render. Defaults to .

fallbackImage (ImageSourcePropType) — Fallback image URL to use if the preview image fails to load.