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

expo-media-preview

v3.1.4

Published

A package for Expo apps that lets users view images, videos, and GIFs in full-screen with pinch-to-zoom, drag-to-dismiss gestures, and smooth animations.

Readme

Expo Media Preview

A lightweight media viewer that allows full-screen (image/video/GIF).

You can pinch zoom-in/out, double-tap zoom-in/out, move and swipe-to-dismiss.

Note: This library is only compatible with Expo 52 and above

Note: If media is of big quality it will take time to render hence spinner

Features

  • Single Tap to open an media full-screen.
  • Pinch to Zoom.
  • Drag to Dismiss.
  • Supports Images, GIFs, and Videos out of the box.

Installation

Using npm:

npm install expo-media-preview

Using yarn:

yarn add expo-media-preview

Additionally, install required peer dependencies:


expo install expo-image expo-video expo-blur

Demo

open and close image modal

Quick Start

  • Install the package (and its peer dependencies).
  • Import and use with either an image or a video source.
import React from "react";
import { View } from "react-native";
import ExpoMediaPreview from "expo-media-preview";

export default function App() {
  const sampleImage = {
    uri: "https://path-to-your-img-file.jpg", // Replace with your image URL
  };

  const sampleVideo = {
    uri: "https://path-to-your-video-file.mp4", // Replace with your video URL
  };

  return (
    <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
      {/* Usage with an image */}
      <ExpoMediaPreview
        source={sampleImage}
        style={{
          height: 150,
          width: 150,
        }}
      />

      {/* Usage with a video */}
      <ExpoMediaPreview
        source={sampleVideo}
        videoPlaceholderSrc={{
          uri: "https://path-to-your-placeholder-image.jpg",
        }}
        isVideo={true}
        style={{
          height: 150,
          width: 150,
        }}
      />
    </View>
  );
}

Behind the Scenes

  • expo-image is used for efficient image loading and caching.
  • expo-video powers the video playback.
  • Pinch, Zoom, and Drag logic is handled via React Native’s PanResponder.
  • expo-blur for background blurring during full-screen mode.

ExpoMediaPreview Component Props

| Prop | Type | Description | |---|---|---| | source | Undefined | Media source | | videoPlaceholder | ImageSourcePropType | Image source for video placeholder | | isVideo | boolean | Determines if the source is a video default false | | style | StyleProp | Style for the original Media | | swipeToDismiss | boolean | Enable swipe to dismiss functionality | | disabled | boolean | Disable opening image modal | | parentLayout | { x: number, y: number, width: number, height: number } | Parent component layout for modal | | animationDuration | number | Duration of animation default 150 | | onTap | (eventParams: OnTap) => void | Callback when media is tapped | | onDoubleTap | () => void | Callback when media is double tapped | | onLongPress | () => void | Callback when media is long pressed | | onOpen | () => void | Callback when media modal is opening | | didOpen | () => void | Callback when media modal is opened | | onMove | (position: OnMove) => void | Callback when modal media is moving | | responderRelease | (vx: number, scale: number) => void | Callback when touch is released | | willClose | () => void | Callback when media modal is closing | | onClose | () => void | Callback when media modal is closed |

  • Video Placeholder (Highly Recommended): Always include videoPlaceholderSrc for videos. This uses expo-image for better quality and caching. Without it, videos render initially muted, paused, and without controls. Regarding Videos:

Made with ❤️ and Expo

Credits: Inspired from react-native-image-modal