Gathering detailed insights and metrics for @d11/react-native-fast-image
Gathering detailed insights and metrics for @d11/react-native-fast-image
π© FastImage, performant React Native image component.
npm install @d11/react-native-fast-image
Typescript
Module System
Node Version
NPM Version
TypeScript (42.91%)
Java (35.02%)
Objective-C++ (12.42%)
Objective-C (3.05%)
JavaScript (2.7%)
Ruby (1.89%)
Kotlin (1.53%)
Shell (0.49%)
Love this project? Help keep it running β sponsor us today! π
Total Downloads
138,134
Last Day
4,176
Last Week
17,564
Last Month
41,681
Last Year
138,134
MIT License
188 Stars
713 Commits
22 Forks
1 Watchers
34 Branches
11 Contributors
Updated on Feb 13, 2025
Latest Version
8.9.1
Package Id
@d11/react-native-fast-image@8.9.1
Unpacked Size
146.31 kB
Size
31.77 kB
File Count
52
NPM Version
10.8.2
Node Version
20.18.1
Published on
Jan 07, 2025
Cumulative downloads
Total Downloads
Last Day
140.7%
4,176
Compared to previous day
Last Week
134.2%
17,564
Compared to previous week
Last Month
112.9%
41,681
Compared to previous month
Last Year
0%
138,134
Compared to previous year
2
29
A high-performance image component for React Native, now fully optimized for the New React Native Architecture! π
FastImage now includes:
FastImage is a drop-in replacement for React Nativeβs Image
component, offering solutions for common image loading challenges like:
FastImage leverages SDWebImage (iOS) and Glide (Android) for native caching and high efficiency.
Experience blazing-fast images with the latest React Native technology.
borderRadius
.To install FastImage in your project, run:
Using yarn
:
1yarn add @d11/react-native-fast-image 2cd ios && pod install
Or using npm
:
1npm install @d11/react-native-fast-image 2cd ios && pod install
Note: You must be using React Native 0.60.0 or higher to use the most recent version of
@d11/react-native-fast-image
.
1import FastImage from "@d11/react-native-fast-image"; 2import * as React from "react"; 3 4const YourImage = () => ( 5 <FastImage 6 style={{ width: 200, height: 200 }} 7 source={{ 8 uri: "https://unsplash.it/400/400?image=1", 9 headers: { Authorization: "someAuthToken" }, 10 priority: FastImage.priority.normal, 11 }} 12 resizeMode={FastImage.resizeMode.contain} 13 /> 14);
AppGlideModule
?If you're already using Glide and an AppGlideModule
, read this guide to ensure smooth integration.
If using ProGuard, add these rules to android/app/proguard-rules.pro
:
1-keep public class com.dylanvann.fastimage.* {*;} 2-keep public class com.dylanvann.fastimage.** {*;} 3-keep public class * implements com.bumptech.glide.module.GlideModule 4-keep public class * extends com.bumptech.glide.module.AppGlideModule 5-keep public enum com.bumptech.glide.load.ImageHeaderParser$** { 6 **[] $VALUES; 7 public *; 8}
Property | Type | Description |
---|---|---|
source | object | Source for the remote image. Accepts an object with sub-properties like uri , headers , priority , and cache . |
source.uri | string | The URL to load the image from. e.g., "https://unsplash.it/400/400?image=1" . |
source.headers | object | Headers to load the image with, e.g., { Authorization: "someAuthToken" } . |
source.priority | FastImage.priority | Load priority: - FastImage.priority.low - FastImage.priority.normal (Default) - FastImage.priority.high |
source.cache | FastImage.cacheControl | Cache control: - FastImage.cacheControl.immutable (Default) - FastImage.cacheControl.web - FastImage.cacheControl.cacheOnly |
defaultSource | number | An asset loaded with require() or import . Note: on Android, defaultSource does not work in debug mode. |
resizeMode | FastImage.resizeMode | Resize mode: - FastImage.resizeMode.contain - FastImage.resizeMode.cover (Default) - FastImage.resizeMode.stretch - FastImage.resizeMode.center |
onLoadStart | function | Callback when the image starts to load. |
onProgress | (event: OnProgressEvent) => void | Callback when the image is loading, with event.nativeEvent.loaded and event.nativeEvent.total bytes. |
onLoad | (event: OnLoadEvent) => void | Callback when the image is successfully loaded, with event.nativeEvent.width and event.nativeEvent.height values. |
onError | function | Callback when an error occurs in loading the image or the source is malformed (empty or null ). |
onLoadEnd | function | Callback when the image finishes loading, regardless of success or failure. |
style | ViewStyle | Style for the image component, supports borderRadius . |
fallback | boolean | If true , it will fall back to using Image . This still applies styles and layout as with FastImage . |
tintColor | number or string | Color tint for all non-transparent pixels in the image. |
testID | string | Optional ID for testing, such as with react-test-renderer . |
Method | Description |
---|---|
FastImage.preload(sources: object[]) | Preloads images for faster display when they are rendered. Example: FastImage.preload([{ uri: "https://unsplash.it/400/400?image=1" }]) . |
FastImage.clearMemoryCache(): Promise<void> | Clears all images from the memory cache. |
FastImage.clearDiskCache(): Promise<void> | Clears all images from the disk cache. |
If you run into issues while using this library, try the solutions in our troubleshooting guide.
This project aims to support the latest version of React Native, simplifying development and testing. For older versions, consider forking the repository if you require specific features or bug fixes.
The original idea for this module came from @vovkasmβs react-native-web-image package.
Special thanks to:
No vulnerabilities found.
No security vulnerabilities found.