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 🙏

© 2025 – Pkg Stats / Ryan Hefner

blur-react-native

v0.1.3

Published

Jellify Blur

Downloads

29

Readme

blur-react-native

A powerful React Native library that provides native blur effects for both iOS and Android. Create beautiful, performant blur overlays with various blur types and customization options.

⚠️ New Architecture Only: This library requires React Native 0.76+ with the New Architecture (Fabric) enabled.

Features

  • 🎨 Multiple Blur Types: Support for 10+ different blur effects on both platforms
  • Native Performance: Uses UIVisualEffectView on iOS and hardware-accelerated blur on Android
  • 🔧 Customizable: Adjustable blur amount and fallback colors
  • Accessibility: Respects reduced transparency settings
  • 📱 Cross-Platform: Works on both iOS and Android with platform-specific optimizations
  • 🚀 New Architecture: Built exclusively for React Native's New Architecture (Fabric)

Requirements

  • React Native 0.76 or higher
  • New Architecture (Fabric) enabled
  • iOS 13.0 or higher
  • Android API 21 (Android 5.0) or higher

Installation

npm install blur-react-native

Or with yarn:

yarn add blur-react-native

iOS Setup

The library will be automatically linked with React Native 0.76+. You just need to install the pods:

cd ios && pod install

Android Setup

The library will be automatically linked with React Native 0.76+. No additional setup is required.

Android Technical Stack

The library automatically chooses the best blur implementation based on the Android API level:

  • Android 12+ (API 31+): Uses RenderEffect for hardware-accelerated blur
  • Android 5.0+ (API 21+): Uses RenderScript with ScriptIntrinsicBlur for GPU-accelerated blur
  • Fallback: Uses optimized software blur with multi-pass box blur algorithm
  • Performance Optimizations: Background threading, bitmap caching, and memory management

Usage

Basic Usage

import React from 'react';
import { View, Text } from 'react-native';
import { BlurView } from 'blur-react-native';

export default function App() {
  return (
    <View style={{ flex: 1 }}>
      <BlurView
        blurType="regular"
        style={{
          position: 'absolute',
          top: 100,
          left: 20,
          right: 20,
          height: 200,
          borderRadius: 20,
        }}
      >
        <Text style={{ textAlign: 'center', marginTop: 50 }}>
          Content on blur background
        </Text>
      </BlurView>
    </View>
  );
}

Advanced Usage with Different Blur Types

import React from 'react';
import { BlurView, BlurType } from 'blur-react-native';

const blurTypes: BlurType[] = [
  'light',
  'dark',
  'regular',
  'systemMaterial',
  'systemThickMaterial',
];

export function BlurDemo() {
  return (
    <View>
      {blurTypes.map((type) => (
        <BlurView
          key={type}
          blurType={type}
          blurAmount={80}
          reducedTransparencyFallbackColor="#FFFFFF"
          style={{
            height: 100,
            margin: 10,
            borderRadius: 15,
          }}
        >
          <Text>{type} blur effect</Text>
        </BlurView>
      ))}
    </View>
  );
}

API Reference

Props

| Prop | Type | Default | Description | | ---------------------------------- | ----------- | ----------- | --------------------------------------------------- | | blurType | BlurType | 'regular' | The type of blur effect to apply | | blurAmount | number | 100 | Blur intensity from 0-100 | | reducedTransparencyFallbackColor | string | '#FFFFFF' | Fallback color when reduced transparency is enabled | | style | ViewStyle | undefined | Style object for the blur view | | children | ReactNode | undefined | Child components to render on top of blur |

Blur Types

The following blur types are available on both platforms:

Standard Blur Effects

  • 'light' - Light blur effect with white tint
  • 'extraLight' - Extra light blur effect with minimal tint
  • 'dark' - Dark blur effect with black tint
  • 'regular' - Standard blur effect with neutral tint
  • 'prominent' - Enhanced blur effect with stronger material appearance

System Material Effects (iOS 13+, Android equivalent)

  • 'systemUltraThinMaterial' - Ultra-thin system material
  • 'systemThinMaterial' - Thin system material
  • 'systemMaterial' - Standard system material
  • 'systemThickMaterial' - Thick system material
  • 'systemChromeMaterial' - Chrome system material

Examples

Overlay Modal

<BlurView blurType="systemMaterial" style={StyleSheet.absoluteFill}>
  <View style={styles.modalContent}>
    <Text>Modal Content</Text>
  </View>
</BlurView>

Card with Blur Background

<BlurView
  blurType="systemThickMaterial"
  blurAmount={90}
  style={{
    padding: 20,
    borderRadius: 16,
    margin: 16,
  }}
>
  <Text style={styles.cardTitle}>Card Title</Text>
  <Text style={styles.cardContent}>Content here</Text>
</BlurView>

Navigation Bar Blur

<BlurView
  blurType="systemChromeMaterial"
  style={{
    position: 'absolute',
    top: 0,
    left: 0,
    right: 0,
    height: 100,
    paddingTop: 50,
  }}
>
  <Text style={styles.navTitle}>Navigation Title</Text>
</BlurView>

Performance

iOS Performance

  • Native UIVisualEffectView: Hardware-accelerated blur with optimal battery usage
  • System-level Optimization: Leverages iOS's built-in blur implementation for optimal performance
  • Automatic Optimization: Adapts to device capabilities and power state

Android Performance

  • Modern Hardware Acceleration: Uses RenderEffect on Android 12+ (API 31+)
  • RenderScript GPU Acceleration: Uses ScriptIntrinsicBlur on Android 5.0+ (API 21-30)
  • Multi-threaded Processing: Background blur calculation to prevent UI blocking
  • Memory Management: Automatic bitmap recycling and memory optimization
  • Caching: Intelligent blur result caching for repeated operations
  • Fallback Support: Optimized software blur for older/unsupported devices

Accessibility

The library automatically respects the system's "Reduce Transparency" accessibility setting:

  • iOS: Automatically detects UIAccessibilityIsReduceTransparencyEnabled()
  • Android: Provides fallback color support for accessibility preferences
  • Customizable: Use reducedTransparencyFallbackColor to set your preferred fallback

Platform Support

  • iOS 13.0+: Native UIVisualEffectView blur effects
  • Android 5.0+ (API 21+): RenderScript hardware-accelerated blur
  • Android 12+ (API 31+): Modern RenderEffect blur
  • React Native 0.76+: New Architecture (Fabric) support only

Platform-Specific Implementation Details

iOS:

  • Uses native UIVisualEffectView for optimal performance and battery life
  • All blur types supported with system-native appearance
  • Automatic dark/light mode adaptation
  • Leverages iOS's built-in hardware acceleration through system APIs

Android:

  • API 31+: android.graphics.RenderEffect for hardware-accelerated blur
  • API 21-30: RenderScript with ScriptIntrinsicBlur for GPU acceleration
  • Fallback: Optimized multi-pass box blur algorithm for older devices
  • Background processing with HandlerThread for smooth UI
  • LRU bitmap caching for performance optimization
  • Automatic memory management and cleanup

Troubleshooting

Common Issues

New Architecture not enabled:

This library requires React Native's New Architecture (Fabric). Ensure you have:

  • React Native 0.76 or higher
  • New Architecture enabled in your app

Pod install fails:

cd ios && rm -rf Pods Podfile.lock && pod install --repo-update

Build errors:

  • Ensure iOS deployment target is 13.0 or higher
  • Ensure Android minSdkVersion is 21 or higher
  • Ensure compileSdkVersion is 31 or higher for modern blur effects
  • Clean build folder: Product → Clean Build Folder in Xcode

Performance issues:

  • The library automatically optimizes for device capabilities
  • On older devices, reduce blurAmount for better performance

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

Disclaimer: Most of this README and code was written by vibe coding™ 🎵✨ - if you find a bug, please raise a PR! We promise it's more fun than debugging alone 😄

License

MIT


Made with create-react-native-library