marshallbear1/react-native-system-thumbnails — explained in plain English
Analysis updated 2026-05-18
Show the native OS thumbnail for a picked document, image, video, or PDF in a React Native app.
Fall back to a consistent file icon when the device cannot generate a real preview.
Cancel an in progress thumbnail request when a user navigates away, using AbortSignal.
Clear only this library's own managed thumbnail cache without touching other app files.
| marshallbear1/react-native-system-thumbnails | airbnb/viaduct | sylvara-lin/lianyu-app | |
|---|---|---|---|
| Stars | 145 | 158 | 167 |
| Language | Kotlin | Kotlin | Kotlin |
| Setup difficulty | moderate | moderate | moderate |
| Complexity | 2/5 | 4/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires React Native's New Architecture and a GitHub personal access token to install from GitHub Packages.
react-native-system-thumbnails is a library for React Native apps that generates the same thumbnail image the phone's operating system would normally show for a local file, and falls back to a plain file icon when a real preview is not possible. It works through one function call, generateThumbnail, that takes the file's location and the size you want, and gives back a file link the app can put straight into an Image component. Under the hood it uses Apple's Quick Look on iOS and a set of native content, image, PDF, and media APIs on Android, rather than trying to render previews in JavaScript. It never downloads remote files, and it will not accept http or https links at all, so any remote file has to be downloaded first through the app's own networking code. This keeps its behavior around permissions, caching, and privacy predictable. The library exists because, according to its README, React Native already has separate libraries for things like video frames or PDF pages, but an app that needs to show a mix of file types, images, videos, PDFs, audio, documents, and files provided by other apps through Android's content system, still has to stitch several libraries together and invent its own fallback for files the device cannot preview. This library gives one consistent result shape across all of those file types, including native previews when possible, a deterministic icon when not, output capped to a chosen pixel size, PNG or JPEG output, source aware caching, and support for canceling a request with an AbortSignal. A generated result reports whether it is a real thumbnail or an icon, its final width and height, its MIME type, and whether it came from the cache. Errors are returned as a typed ThumbnailError with a stable code such as invalid argument, not found, permission denied, cancelled, or generation failed. There is also a function to clear the library's own managed cache, which only ever removes files inside its own cache directory. The project requires React Native's New Architecture, React Native 0.86 or newer, iOS 15.1 or newer, and Android API 24 or newer, and it is installed from GitHub's package registry using a personal access token rather than the regular npm registry. The README describes a test strategy that goes beyond mocking JavaScript, including TypeScript and Jest tests plus Android Robolectric tests covering caching, fallback behavior, and cancellation.
A React Native library that generates the operating system's own file thumbnail, or a fallback icon, for local images, PDFs, videos, and documents.
Mainly Kotlin. The stack also includes React Native, Kotlin, TypeScript.
The README does not state a license, so reuse terms are unknown until the repository's license file is checked.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.