npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-preview-url

v0.1.4

Published

A React Native component to generate rich link previews by fetching metadata (title, description, images) from URLs. Easily integrate customizable and lightweight link previews into your app.

Readme

React Native Preview Url

A React Native library that provides an easy way to fetch and display link previews using the useUrlPreview hook and a customizable <LinkPreview /> component. It uses our own open-source free open source API azizbecha-link-preview-api available on GitHub at https://github.com/azizbecha/link-preview-api.

Features

  • Fetches metadata (title, description, images, favicons, etc.) from URLs
  • Customizable preview component with styles and fallback support
  • Supports timeout and error handling
  • Handles URL validation and loading states

Installation

npm install react-native-preview-url
# or
yarn add react-native-preview-url

Usage

useUrlPreview Hook

import { useUrlPreview } from 'react-native-preview-url';

const { loading, data, error } = useUrlPreview('https://github.com');

<LinkPreview /> Component

import React from 'react';
import { LinkPreview } from 'react-native-preview-url';

export const Example = () => (
  <LinkPreview
    url="https://github.com"
    timeout={3000} // optional, default timeout in ms
    onSuccess={(metadata) => console.log(metadata)}
    onError={(error) => console.error(error)}
    onPress={() => console.log('Pressed preview')}
    containerStyle={{ margin: 16, borderRadius: 8, backgroundColor: '#fff' }}
    imageStyle={{ borderRadius: 8, height: 150 }}
    titleStyle={{ fontSize: 18, fontWeight: 'bold' }}
    descriptionStyle={{ fontSize: 14, color: '#555' }}
    urlStyle={{ fontSize: 12, color: 'grey' }}
    titleLines={2}
    descriptionLines={3}
    showUrl={true}
    hideImage={false}
  />
);

Props

| Prop | Type | Required | Default | Description | | ------------------ | ------------------------------------- | -------- | ------------------- | ---------------------------------------------------- | | url | string | Yes | - | The URL to fetch metadata for | | timeout | number | No | 3000 | Fetch timeout in milliseconds | | onSuccess | (data: LinkPreviewResponse) => void | No | - | Callback when data is successfully fetched | | onError | (error: string) => void | No | - | Callback when fetching metadata fails | | onPress | (url: string) => void | No | - | Callback when the preview component is pressed | | containerStyle | ViewStyle | No | - | Style for the container view | | imageStyle | ImageStyle | No | - | Style for the preview image | | titleStyle | TextStyle | No | - | Style for the title text | | descriptionStyle | TextStyle | No | - | Style for the description text | | urlStyle | TextStyle | No | - | Style for the URL text | | titleLines | number | No | 2 | Number of lines for title text truncation | | descriptionLines | number | No | 4 | Number of lines for description text truncation | | showUrl | boolean | No | true | Whether to show the URL domain below the description | | hideImage | boolean | No | false | Whether to hide the preview image | | visible | boolean | No | true | Whether to show or hide the preview component | | loaderComponent | ReactNode | No | ActivityIndicator | Custom loading component | | fallbackImage | ImageSourcePropType | No | undefined | Fallback image in case the website doesn't have one |

Example Response Object

{
  "status": 200,
  "title": "azizbecha - Overview",
  "description": "I'm fixing bugs now, I'll write a bio later. azizbecha has 26 repositories available. Follow their code on GitHub.",
  "url": "https://github.com/azizbecha",
  "images": [
    "https://avatars.githubusercontent.com/u/63454940?v=4?s=400"
  ],
  "favicons": [
    "https://github.githubassets.com/favicons/favicon.svg"
  ],
  "mediaType": "profile",
  "contentType": "text/html",
  "siteName": "GitHub"
}

License

MIT License