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

@twinedo/react-native-image-placeholder

v1.0.16

Published

A zero-config React Native wrapper that automatically shows a blur or placeholder while images load, then fades it out smoothly.

Readme

@twinedo/react-native-image-placeholder

A zero-config React Native wrapper that automatically shows a blur or placeholder while images load, then fades it out smoothly.

Installation

npm install @twinedo/react-native-image-placeholder react-native-reanimated

Optional blur support (install one):

npm install @react-native-community/blur
npm install expo-blur

Basic usage

import { Image } from 'react-native';
import { ImagePlaceholder } from '@twinedo/react-native-image-placeholder';

<ImagePlaceholder>
  <Image
    source={{ uri: 'https://example.com/hero.jpg' }}
    style={{ width: 240, height: 160, borderRadius: 12 }}
  />
</ImagePlaceholder>;

Children must be a single Image-like element (React Native Image, expo-image, FastImage, or any component that forwards load events).

Props

<ImagePlaceholder
  enabled?: boolean // default true
  minDelay?: number // default 150
  fadeDuration?: number // default 600
  overlay?: ReactNode
  blurAmount?: number
  overlayColor?: string
  logoUri?: string | ImageSourcePropType
  logoWidth?: number
  logoHeight?: number
  fallback?: 'auto' | 'delay' | 'none'
  style?: ViewStyle
>
  {childImage}
</ImagePlaceholder>

API

| Prop | Type | Optional | Default | Description | | --- | --- | --- | --- | --- | | children | ReactElement | false | — | Single Image-like element (Image, expo-image, FastImage, or custom). | | enabled | boolean | true | true | Toggle the overlay behavior on/off. | | minDelay | number | true | 150 | Minimum time (ms) the overlay stays visible when using fallback delay. | | fadeDuration | number | true | 600 | Fade-out duration (ms) for the overlay. | | overlay | ReactNode | true | — | Custom overlay; overrides blur/placeholder rendering. | | blurAmount | number | true | — | Blur intensity when BlurView is available. | | overlayColor | string | true | rgba(0, 0, 0, 0.08) | Tint color for the default placeholder/blur overlay. | | logoUri | string | ImageSourcePropType | true | — | Centered logo shown during loading. | | logoWidth | number | true | 56 | Logo width in pixels. | | logoHeight | number | true | 56 | Logo height in pixels. | | fallback | 'auto' | 'delay' | 'none' | true | auto | How to behave when lifecycle events are unavailable. | | style | ViewStyle | true | — | Style applied to the wrapper container. |

Notes:

  • overlay replaces the default placeholder/blur entirely.
  • overlay renders inside an absolute-fill container; use StyleSheet.absoluteFillObject if you want it to cover the image.
  • blurAmount uses an optional BlurView if installed; otherwise the default placeholder is used.
  • overlayColor tints the default placeholder/blur (use a darker rgba to deepen the dim effect).
  • logoUri adds a centered logo on top of the default placeholder/blur. It accepts a remote uri string or a static require() asset.
  • fallback controls the behavior when lifecycle events are unavailable:
    • auto: use load events when available, otherwise fall back to a timed delay.
    • delay: always use the timed delay (useful for custom images that never emit events).
    • none: only use lifecycle events and never fall back.

Fallback delay behavior

When fallback is active, the overlay stays visible for at least minDelay and then fades out over fadeDuration. This prevents flashes for cached images and still feels responsive for fast loads.

Blur overlay

<ImagePlaceholder blurAmount={12}>
  <Image source={{ uri: 'https://example.com/hero.jpg' }} style={{ width: 240, height: 160 }} />
</ImagePlaceholder>

If you want full control, pass a custom overlay:

import { StyleSheet } from 'react-native';
import { BlurView } from '@react-native-community/blur';

<ImagePlaceholder
  overlay={<BlurView blurAmount={16} style={{ ...StyleSheet.absoluteFillObject }} />}
>
  <Image source={{ uri: 'https://example.com/hero.jpg' }} style={{ width: 240, height: 160 }} />
</ImagePlaceholder>

Logo overlay

const logo = require('./assets/icon.png');

<ImagePlaceholder blurAmount={12} logoUri={logo} logoWidth={64} logoHeight={64}>
  <Image source={{ uri: 'https://example.com/hero.jpg' }} style={{ width: 240, height: 160 }} />
</ImagePlaceholder>

Expo + Bare React Native notes

  • react-native-reanimated is required. Ensure the Reanimated Babel plugin is installed and configured.
  • Bare React Native: after installing native deps, run pod install in the ios directory.
  • Expo: use expo-blur for blur overlays or pass a custom overlay. Expo already configures Reanimated for managed projects.

Example usage snippet

import { Image } from 'react-native';
import { ImagePlaceholder } from '@twinedo/react-native-image-placeholder';

export function Avatar() {
  return (
    <ImagePlaceholder fadeDuration={500} minDelay={120} blurAmount={10}>
      <Image
        source={{ uri: 'https://images.example.com/avatar.png' }}
        style={{ width: 80, height: 80, borderRadius: 40 }}
      />
    </ImagePlaceholder>
  );
}

Contributing

License

MIT


Made with create-react-native-library