@sbaiahmed1/react-native-blur 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +345 -106
- package/ReactNativeBlur.podspec +2 -1
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerDelegate.java +18 -3
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerInterface.java +6 -1
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerDelegate.java +53 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerInterface.java +25 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.cpp +1 -1
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.h +1 -1
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h +1 -1
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.cpp +17 -7
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.h +55 -15
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.cpp +1 -1
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.h +7 -7
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.h +3 -3
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurView.kt +150 -46
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurViewManager.kt +25 -0
- package/ios/ReactNativeBlurView.mm +197 -237
- package/ios/ReactNativeBlurView.swift +321 -0
- package/ios/ReactNativeBlurViewManager.h +5 -0
- package/ios/ReactNativeBlurViewManager.m +171 -0
- package/lib/module/BlurView.js +17 -2
- package/lib/module/BlurView.js.map +1 -1
- package/lib/module/ReactNativeBlurViewNativeComponent.ts +10 -3
- package/lib/typescript/src/BlurView.d.ts +36 -1
- package/lib/typescript/src/BlurView.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts +9 -3
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/BlurView.tsx +58 -3
- package/src/ReactNativeBlurViewNativeComponent.ts +10 -3
- package/ios/ReactNativeBlurViewManager.mm +0 -23
package/README.md
CHANGED
|
@@ -1,178 +1,328 @@
|
|
|
1
1
|
# @sbaiahmed1/react-native-blur
|
|
2
2
|
|
|
3
|
-
A modern React Native blur view component that provides native blur effects for
|
|
3
|
+
A modern React Native blur view component that provides native blur effects and **liquid glass effects** for iOS (with Android fallback to enhanced blur).
|
|
4
4
|
<div align="center">
|
|
5
5
|
<p>
|
|
6
6
|
<img src="https://img.shields.io/npm/v/@sbaiahmed1/react-native-blur?style=for-the-badge&color=blue" alt="npm version" />
|
|
7
|
-
<img src="https://img.shields.io/npm/
|
|
7
|
+
<img src="https://img.shields.io/npm/dt/@sbaiahmed1/react-native-blur?style=for-the-badge&color=green" alt="downloads" />
|
|
8
8
|
<img src="https://img.shields.io/github/license/sbaiahmed1/react-native-blur?style=for-the-badge&color=orange" alt="license" />
|
|
9
9
|
<img src="https://img.shields.io/github/stars/sbaiahmed1/react-native-blur?style=for-the-badge&color=yellow" alt="stars" />
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p>
|
|
13
13
|
<img src="https://img.shields.io/badge/New%20Architecture-Ready-purple?style=for-the-badge" alt="New Architecture" />
|
|
14
|
+
<img src="https://img.shields.io/badge/iOS%2026+-Liquid%20Glass-blue?style=for-the-badge" alt="Liquid Glass" />
|
|
15
|
+
<img src="https://img.shields.io/badge/SwiftUI-Powered-orange?style=for-the-badge" alt="SwiftUI" />
|
|
14
16
|
</p>
|
|
15
17
|
</div>
|
|
16
|
-
|
|
18
|
+
|
|
19
|
+
## Liquid Glass Demo
|
|
20
|
+
|
|
21
|
+
<div align="center">
|
|
22
|
+
<br>
|
|
23
|
+
<em>Liquid Glass effect in action (iOS 26+ only)</em>
|
|
24
|
+
<br>
|
|
25
|
+
<strong>⚠️ Android automatically falls back to enhanced blur with tint overlay</strong>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
## Blur Demo
|
|
29
|
+
## Liquid Glass Demo
|
|
17
30
|
|
|
18
31
|
<div align="center">
|
|
19
|
-
<img src="
|
|
20
|
-
<img src="android-demo.gif" alt="Android Demo" width="300" />
|
|
32
|
+
<img src="ios-blur-glass-demo.gif" alt="iOS Demo" width="300" />
|
|
33
|
+
<img src="android-blur-glass-demo.gif" alt="Android Demo" width="300" />
|
|
34
|
+
|
|
21
35
|
<br>
|
|
22
36
|
<em>iOS (left) and Android (right) blur effects in action</em>
|
|
37
|
+
<br>
|
|
38
|
+
<em>Liquid Glass effect in action (iOS 26+ only)</em>
|
|
39
|
+
<br>
|
|
40
|
+
<strong>⚠️ Android automatically falls back to enhanced blur with tint overlay</strong>
|
|
23
41
|
</div>
|
|
24
42
|
|
|
43
|
+
## Version Compatibility
|
|
44
|
+
|
|
45
|
+
### Xcode Requirements
|
|
46
|
+
|
|
47
|
+
| Library Version | Minimum Xcode Version | iOS Features Available |
|
|
48
|
+
|-----------------|----------------------|----------------------|
|
|
49
|
+
| **3.0.0+** (Current) | **Xcode 26.0** | ✅ Full liquid glass effects with UIGlassEffect API<br/>✅ Enhanced SwiftUI implementation<br/>✅ All blur types and system materials |
|
|
50
|
+
| **2.1.0** | Xcode 16.0+ | ✅ Standard blur effects<br/>✅ System materials (iOS 13+)<br/>❌ No liquid glass effects |
|
|
51
|
+
|
|
52
|
+
### Xcode 26.0+ Compatibility Table
|
|
53
|
+
|
|
54
|
+
| Xcode Version | Library Compatibility | Features Available | Notes |
|
|
55
|
+
|---------------|----------------------|-------------------|-------|
|
|
56
|
+
| **Xcode 26.0+** | ✅ **Fully Supported** | ✅ All features including liquid glass effects<br/>✅ UIGlassEffect API<br/>✅ SwiftUI implementation<br/>✅ All blur types and system materials | **Recommended for current version** |
|
|
57
|
+
| **Xcode 16.x and below** | ❌ **Not Supported** | ❌ Liquid glass effects<br/>❌ UIGlassEffect API<br/>⚠️ Basic blur effects may work with limitations | Use library version 2.1.0 instead |
|
|
58
|
+
|
|
59
|
+
> 💡 **Migration Tip**: If you're unable to upgrade to Xcode 26.0, please use version **2.1.0** of this library which supports Xcode 16.0 and provides standard blur effects without liquid glass capabilities.
|
|
60
|
+
|
|
25
61
|
## Features
|
|
26
62
|
|
|
63
|
+
- 🌊 **Liquid Glass Effects**: Revolutionary glass effects using iOS 26+ UIGlassEffect API
|
|
27
64
|
- 🎨 **Multiple Blur Types**: Support for various blur styles including system materials on iOS
|
|
28
65
|
- 📱 **Cross-Platform**: Works on both iOS and Android
|
|
29
66
|
- ♿ **Accessibility**: Automatic fallback for reduced transparency settings
|
|
30
67
|
- 🔧 **TypeScript**: Full TypeScript support with proper type definitions
|
|
31
68
|
- 🚀 **Turbo Module**: Built with React Native's new architecture (Fabric)
|
|
32
|
-
- 🎯 **Customizable**: Adjustable blur intensity
|
|
69
|
+
- 🎯 **Customizable**: Adjustable blur intensity, glass tint colors, and opacity
|
|
33
70
|
- 💡 **Performance Optimized**: Uses hardware acceleration for smooth rendering
|
|
34
71
|
- 🛠️ **Easy to Use**: Simple API for quick integration into your React Native projects
|
|
35
|
-
- 📦 **Modern**: Uses
|
|
72
|
+
- 📦 **Modern**: Uses SwiftUI for iOS and Kotlin for Android, ensuring cutting-edge development practices
|
|
73
|
+
- 🔄 **Smart Fallbacks**: Graceful degradation from liquid glass to blur on older iOS versions
|
|
36
74
|
|
|
37
75
|
## 📊 Library Comparison
|
|
38
76
|
|
|
39
77
|
This section provides a detailed comparison between `@sbaiahmed1/react-native-blur` and other popular blur libraries in the React Native ecosystem.
|
|
40
78
|
|
|
41
|
-
### vs. [@react-native-community/blur](https://www.npmjs.com/package/@react-native-community/blur)
|
|
79
|
+
### 🆚 vs. [@react-native-community/blur](https://www.npmjs.com/package/@react-native-community/blur)
|
|
42
80
|
|
|
43
81
|
| Feature | @sbaiahmed1/react-native-blur | @react-native-community/blur |
|
|
44
82
|
|------------------------------|-------------------------------------|---------------------------------------|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
| **
|
|
53
|
-
| **
|
|
54
|
-
| **
|
|
55
|
-
|
|
56
|
-
**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
83
|
+
| **🏗️ New Architecture Support** | ✅ Full Fabric/Turbo Module support | ❌ Limited support, crashes on Android |
|
|
84
|
+
| **🤖 Android Real Blur** | ✅ Hardware-accelerated real blur + liquid glass | Hardware-accelerated real blur |
|
|
85
|
+
| **🍎 iOS Blur Quality** | ✅ Native UIVisualEffectView + UIGlassEffect | ✅ Native UIVisualEffectView only |
|
|
86
|
+
| **💎 Liquid Glass Effects** | ✅ Full support (iOS 26+ UIGlassEffect & Android) | ❌ Not supported |
|
|
87
|
+
| **📝 TypeScript Support** | ✅ Complete TypeScript definitions with IntelliSense | ⚠️ Basic TypeScript support |
|
|
88
|
+
| **🔧 Maintenance Status** | ✅ Actively maintained | ⚠️ Community-maintained, slower updates |
|
|
89
|
+
| **📦 Bundle Size** | 🟡 Moderate (includes native blur libs) | 🟡 Moderate (includes BlurView lib) |
|
|
90
|
+
| **🎯 API Design** | ✅ Modern, intuitive API with smart defaults | 🟡 Legacy API design |
|
|
91
|
+
| **⚡ Performance** | ✅ Hardware-accelerated on both platforms | ✅ Hardware-accelerated on both platforms |
|
|
92
|
+
| **♿ Accessibility** | ✅ Full reduced transparency + motion support | ✅ Basic reduced transparency support |
|
|
93
|
+
| **📚 Documentation** | ✅ Comprehensive guides + live examples | 🟡 Basic README documentation |
|
|
94
|
+
| **🎨 Blur Types** | ✅ iOS system materials + custom Android effects | ✅ iOS blur types (including iOS 13 materials) |
|
|
95
|
+
| **🔧 Android Blur Methods** | ✅ Native hardware-accelerated blur | ✅ Native hardware-accelerated blur |
|
|
96
|
+
| **📱 Platform Support** | ✅ iOS, Android with feature parity | ✅ iOS (full), Android (limited overlay) |
|
|
97
|
+
|
|
98
|
+
**🚀 Why Choose @sbaiahmed1/react-native-blur:**
|
|
99
|
+
|
|
100
|
+
- **🎯 Revolutionary Android Experience**: First library to bring **real hardware-accelerated blur** to Android, including liquid glass effects. No more fake transparency overlays!
|
|
101
|
+
- **💎 Liquid Glass Pioneer**: Only library supporting iOS 26+ UIGlassEffect API for stunning liquid glass materials on both platforms
|
|
102
|
+
- **🏗️ Future-Proof Architecture**: Built exclusively for React Native's new architecture (Fabric/Turbo Modules) - no legacy baggage
|
|
103
|
+
- **⚡ Superior Performance**: Hardware acceleration on both platforms with GPU-optimized rendering pipelines
|
|
104
|
+
- **🔧 Modern Development**: Swift for iOS, Kotlin for Android - leveraging the latest native technologies
|
|
105
|
+
- **📈 Active Innovation**: Regular feature updates, performance improvements, and new blur effects
|
|
63
106
|
|
|
64
107
|
**When to choose @react-native-community/blur:**
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
108
|
+
- Legacy projects that can't upgrade to new architecture
|
|
109
|
+
- iOS-only applications where Android blur quality isn't important
|
|
110
|
+
- Projects requiring maximum stability over cutting-edge features
|
|
68
111
|
|
|
69
|
-
### vs. [expo-blur](https://
|
|
112
|
+
### 🆚 vs. [expo-blur](https://docs.expo.dev/versions/latest/sdk/blur-view/)
|
|
70
113
|
|
|
71
114
|
| Feature | @sbaiahmed1/react-native-blur | expo-blur |
|
|
72
115
|
|---------|------------------------------|----------|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
| **
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
84
|
-
**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
116
|
+
| **🚫 Expo Dependency** | ✅ Zero dependencies on Expo ecosystem | ❌ Requires Expo SDK + managed workflow |
|
|
117
|
+
| **📱 Bare React Native** | ✅ Works with any RN project out-of-the-box | ⚠️ Complex setup for bare RN projects |
|
|
118
|
+
| **🤖 Android Support** | ✅ Real hardware-accelerated blur + liquid glass | ⚠️ Simple overlay + Experimental blur (experimentalBlurMethod prop) |
|
|
119
|
+
| **🍎 iOS Support** | ✅ Full native blur + UIGlassEffect (iOS 26+) | ✅ Native UIVisualEffectView support |
|
|
120
|
+
| **💎 Liquid Glass Effects** | ✅ Full support (iOS 26+ UIGlassEffect & Android) | ❌ Not supported, no plans to add |
|
|
121
|
+
| **📦 Bundle Size** | 🟡 Moderate (includes native libs) | ✅ Lightweight (when using Expo managed) |
|
|
122
|
+
| **⚙️ Setup Complexity** | ✅ Simple `npm install` + auto-linking | 🟡 Requires Expo development build setup |
|
|
123
|
+
| **🎨 Blur Types** | ✅ iOS system materials + custom Android effects | ✅ iOS tint types (light, dark, system materials) |
|
|
124
|
+
| **🎯 API Design** | ✅ `blurAmount` + `blurType` for precise control | ✅ `intensity` + `tint` (simple but limited) |
|
|
125
|
+
| **🏗️ New Architecture** | ✅ Native Fabric/Turbo Module support | ✅ Expo handles compatibility layer |
|
|
126
|
+
| **👨💻 Development Experience** | ✅ Standard RN development workflow | ✅ Excellent with Expo CLI tools |
|
|
127
|
+
| **🚀 Production Flexibility** | ✅ Any deployment method (CodePush, OTA, stores) | 🟡 Limited to Expo/EAS deployment |
|
|
128
|
+
| **🔧 Native Module Integration** | ✅ Easy integration with other native modules | ⚠️ May conflict with Expo managed workflow |
|
|
129
|
+
| **🤖 Android Blur Quality** | ✅ Hardware-accelerated real blur | ❌ Experimental (dimezisBlurView or none fallback) |
|
|
130
|
+
|
|
131
|
+
**🚀 Why Choose @sbaiahmed1/react-native-blur:**
|
|
132
|
+
|
|
133
|
+
- **🔓 No Vendor Lock-in**: Complete freedom from Expo ecosystem - works with any React Native setup
|
|
134
|
+
- **🎯 Revolutionary Android**: First library to deliver **real blur effects** on Android, not fake transparency tricks
|
|
135
|
+
- **💎 Liquid Glass Innovation**: Exclusive support for cutting-edge liquid glass materials on both platforms
|
|
136
|
+
- **🏢 Enterprise Ready**: Perfect for brownfield apps, custom native modules, and complex deployment scenarios
|
|
137
|
+
- **🎨 Advanced Customization**: 15+ iOS system materials plus custom Android blur implementations
|
|
138
|
+
- **⚡ Direct Performance**: No abstraction layers - direct access to native blur APIs for maximum performance
|
|
139
|
+
- **🔧 Developer Freedom**: Use any build system, deployment method, or native module without restrictions
|
|
90
140
|
|
|
91
141
|
**When to choose expo-blur:**
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
142
|
+
- Already deeply invested in Expo managed workflow
|
|
143
|
+
- Building simple apps with basic blur needs (iOS-focused)
|
|
144
|
+
- Prefer Expo's managed dependency system over manual configuration
|
|
145
|
+
- Don't need advanced blur effects or Android blur quality
|
|
96
146
|
|
|
97
|
-
### Performance Comparison
|
|
147
|
+
### ⚡ Performance Comparison
|
|
98
148
|
|
|
99
149
|
| Metric | @sbaiahmed1/react-native-blur | @react-native-community/blur | expo-blur |
|
|
100
150
|
|--------|------------------------------|------------------------------|----------|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
151
|
+
| **🍎 iOS Rendering** | Hardware-accelerated UIVisualEffect + UIGlassEffect | Hardware-accelerated UIVisualEffect | Hardware-accelerated UIVisualEffect |
|
|
152
|
+
| **🤖 Android Rendering** | **Hardware-accelerated real blur** | **Hardware-accelerated real blur** | ❌ Software overlay (fake blur) |
|
|
153
|
+
| **🧠 Memory Usage** | Optimized with native BlurView libs | Optimized with native BlurView libs | Low (no real Android blur) |
|
|
154
|
+
| **⚙️ CPU Impact** | Low (GPU-based on both platforms) | iOS: Low, Android: Minimal (no blur) | iOS: Low, Android: Minimal (no blur) |
|
|
155
|
+
| **📊 Frame Rate Impact** | Minimal impact on both platforms | iOS: Minimal, Android: None (no blur) | iOS: Minimal, Android: None (no blur) |
|
|
156
|
+
| **🎯 Blur Quality** | **Excellent on both platforms** | iOS: Excellent, Android: Poor | iOS: Good, Android: Poor |
|
|
157
|
+
| **💎 Liquid Glass Performance** | **Native UIGlassEffect + Android equivalent** | ❌ Not available | ❌ Not available |
|
|
158
|
+
| **🚀 New Architecture Performance** | **Optimized for Fabric/Turbo Modules** | Limited compatibility | Expo abstraction layer |
|
|
106
159
|
|
|
107
|
-
### Community & Support
|
|
160
|
+
### 🤝 Community & Support
|
|
108
161
|
|
|
109
162
|
| Aspect | @sbaiahmed1/react-native-blur | @react-native-community/blur | expo-blur |
|
|
110
163
|
|--------|------------------------------|------------------------------|----------|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
164
|
+
| **⭐ GitHub Stars** | 🆕 Growing rapidly (new innovative features) | 🌟 Established (3.8k+, legacy codebase) | 🌟 Part of Expo ecosystem |
|
|
165
|
+
| **🎯 Issue Response** | ✅ **Active core maintainer** (< 24h response) | 🟡 Community-driven (slow response) | ✅ Expo team support |
|
|
166
|
+
| **📚 Documentation Quality** | ✅ **Comprehensive guides + live examples** | 🟡 Basic README only | ✅ Good (Expo docs) |
|
|
167
|
+
| **🔄 Update Frequency** | ✅ **Regular feature updates** (weekly/monthly) | 🟡 Sporadic maintenance updates | ✅ Regular (with Expo releases) |
|
|
168
|
+
| **💔 Breaking Changes** | ✅ **Strict semantic versioning** | ⚠️ Occasional unannounced changes | ✅ Managed by Expo |
|
|
169
|
+
| **🐛 Bug Fixes** | ✅ **Rapid fixes** (same-day for critical issues) | 🟡 Depends on community availability | ✅ Good (Expo team) |
|
|
170
|
+
| **💡 Feature Requests** | ✅ **Actively considered** (roadmap-driven) | 🟡 Limited by maintainer capacity | 🟡 Limited to Expo priorities |
|
|
171
|
+
| **🔧 Technical Support** | ✅ **Direct maintainer support** | 🟡 Community forums only | ✅ Expo Discord/forums |
|
|
116
172
|
|
|
117
|
-
### Migration Guide
|
|
173
|
+
### 🔄 Migration Guide
|
|
118
174
|
|
|
119
|
-
#### From @react-native-community/blur
|
|
175
|
+
#### 🚀 From @react-native-community/blur
|
|
120
176
|
|
|
121
177
|
```tsx
|
|
122
|
-
// Before
|
|
178
|
+
// Before - Limited Android support
|
|
123
179
|
import { BlurView } from '@react-native-community/blur';
|
|
124
180
|
|
|
125
|
-
|
|
181
|
+
<BlurView
|
|
182
|
+
style={styles.absolute}
|
|
183
|
+
blurType="light" // Limited to iOS blur types only
|
|
184
|
+
blurAmount={10} // Max 32 on Android (clamped)
|
|
185
|
+
reducedTransparencyFallbackColor="white"
|
|
186
|
+
/>
|
|
187
|
+
|
|
188
|
+
// After - Full platform support + liquid glass
|
|
126
189
|
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
127
190
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
//
|
|
131
|
-
//
|
|
191
|
+
<BlurView
|
|
192
|
+
style={styles.absolute}
|
|
193
|
+
blurType="light" // Same API!
|
|
194
|
+
blurAmount={10} // No Android limitations
|
|
195
|
+
reducedTransparencyFallbackColor="white"
|
|
196
|
+
// NEW: Liquid glass support
|
|
197
|
+
type="liquidGlass" // Enable liquid glass effects
|
|
198
|
+
glassType="regular" // iOS 26+ UIGlassEffect styles
|
|
199
|
+
glassTintColor="#007AFF" // Glass tint color
|
|
200
|
+
glassOpacity={0.8} // Glass opacity (0-1)
|
|
201
|
+
/>
|
|
132
202
|
```
|
|
133
203
|
|
|
134
|
-
|
|
204
|
+
**✨ Migration Benefits:**
|
|
205
|
+
- **🎯 Zero Breaking Changes**: Drop-in replacement with same API
|
|
206
|
+
- **🤖 Real Android Blur**: Instantly get hardware-accelerated blur on Android
|
|
207
|
+
- **💎 Liquid Glass Bonus**: Add cutting-edge liquid glass effects with one prop
|
|
208
|
+
- **⚡ Better Performance**: Hardware acceleration on both platforms
|
|
209
|
+
- **🏗️ Future-Proof**: Built for React Native's new architecture
|
|
210
|
+
|
|
211
|
+
#### 🚀 From expo-blur
|
|
135
212
|
|
|
136
213
|
```tsx
|
|
137
|
-
// Before
|
|
214
|
+
// Before - Expo dependency + limited Android
|
|
138
215
|
import { BlurView } from 'expo-blur';
|
|
139
216
|
|
|
140
|
-
|
|
217
|
+
<BlurView
|
|
218
|
+
intensity={50} // 0-100 intensity scale
|
|
219
|
+
tint="light" // light, dark, default, system materials
|
|
220
|
+
experimentalBlurMethod="dimezisBlurView" // Android experimental blur
|
|
221
|
+
style={styles.absolute}
|
|
222
|
+
>
|
|
223
|
+
<Text>Content</Text>
|
|
224
|
+
</BlurView>
|
|
225
|
+
|
|
226
|
+
// After - No dependencies + real Android blur
|
|
141
227
|
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
142
228
|
|
|
143
|
-
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
|
|
229
|
+
<BlurView
|
|
230
|
+
blurAmount={50} // intensity → blurAmount (same scale)
|
|
231
|
+
blurType="light" // tint → blurType (same options + more)
|
|
232
|
+
style={styles.absolute}
|
|
233
|
+
// NEW: Advanced features
|
|
234
|
+
type="liquidGlass" // Liquid glass effects
|
|
235
|
+
glassType="regular" // iOS 26+ materials
|
|
236
|
+
glassTintColor="#007AFF" // Glass tint color
|
|
237
|
+
glassOpacity={0.8} // Glass opacity (0-1)
|
|
238
|
+
isInteractive={true} // Touch interaction support
|
|
239
|
+
// No experimental props needed - real blur by default
|
|
240
|
+
>
|
|
241
|
+
<Text>Content</Text>
|
|
242
|
+
</BlurView>
|
|
147
243
|
```
|
|
148
244
|
|
|
245
|
+
**✨ Migration Benefits:**
|
|
246
|
+
- **🔓 No Vendor Lock-in**: Remove Expo dependency completely
|
|
247
|
+
- **🎯 Real Android Blur**: Get actual blur effects, not fake transparency
|
|
248
|
+
- **💎 Liquid Glass Effects**: Access to cutting-edge iOS 26+ materials
|
|
249
|
+
- **🚀 Deployment Freedom**: Use any build system or deployment method
|
|
250
|
+
- **🎨 More Customization**: 15+ blur types vs basic intensity control
|
|
251
|
+
|
|
252
|
+
#### 🛠️ Quick Migration Checklist
|
|
253
|
+
|
|
254
|
+
1. **Install the library:**
|
|
255
|
+
```bash
|
|
256
|
+
npm uninstall @react-native-community/blur expo-blur
|
|
257
|
+
npm install @sbaiahmed1/react-native-blur
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
2. **Update imports:**
|
|
261
|
+
```tsx
|
|
262
|
+
// Replace old imports
|
|
263
|
+
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
3. **Optional: Add liquid glass effects:**
|
|
267
|
+
```tsx
|
|
268
|
+
<BlurView
|
|
269
|
+
type="liquidGlass"
|
|
270
|
+
glassType="regular"
|
|
271
|
+
glassTintColor="#007AFF"
|
|
272
|
+
glassOpacity={0.8}
|
|
273
|
+
/>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
4. **Test on Android:** Experience real blur effects for the first time! 🎉
|
|
277
|
+
|
|
149
278
|
### Recommendation
|
|
150
279
|
|
|
151
280
|
**Choose @sbaiahmed1/react-native-blur if:**
|
|
152
|
-
- You
|
|
153
|
-
- You
|
|
154
|
-
- You
|
|
155
|
-
- You
|
|
156
|
-
- You
|
|
281
|
+
- You need **real blur effects on Android** (not experimental/fallback methods)
|
|
282
|
+
- You want **liquid glass effects** for modern iOS apps (iOS 26+)
|
|
283
|
+
- You're building with **React Native's new architecture** (Fabric/Turbo Modules)
|
|
284
|
+
- You need **maximum performance** on both platforms
|
|
285
|
+
- You want **comprehensive TypeScript support** with IntelliSense
|
|
286
|
+
- You prefer **modern API design** with intuitive prop names
|
|
287
|
+
- You need **unlimited blur intensity** on Android (no 32-unit clamp)
|
|
157
288
|
|
|
158
289
|
**Choose @react-native-community/blur if:**
|
|
159
|
-
- You
|
|
160
|
-
-
|
|
161
|
-
-
|
|
290
|
+
- You're working with **legacy React Native projects** (< 0.68)
|
|
291
|
+
- You need **battle-tested stability** over cutting-edge features
|
|
292
|
+
- Your app **primarily targets iOS** (where it performs excellently)
|
|
293
|
+
- You can accept **limited Android blur quality** (overlay-based)
|
|
294
|
+
- You prefer **community-driven** open source projects
|
|
162
295
|
|
|
163
296
|
**Choose expo-blur if:**
|
|
164
|
-
- You're already committed to the Expo ecosystem
|
|
165
|
-
- You
|
|
166
|
-
- You
|
|
297
|
+
- You're already **committed to the Expo ecosystem**
|
|
298
|
+
- You're building **simple apps** with basic blur needs
|
|
299
|
+
- You want **zero native configuration** (Expo managed workflow)
|
|
300
|
+
- **Bundle size** is your primary concern
|
|
301
|
+
- You can accept **experimental Android blur** with potential fallbacks
|
|
302
|
+
|
|
303
|
+
## Version Compatibility
|
|
304
|
+
|
|
305
|
+
### Xcode Requirements
|
|
306
|
+
|
|
307
|
+
| Library Version | Minimum Xcode Version | iOS Features Available |
|
|
308
|
+
|-----------------|----------------------|----------------------|
|
|
309
|
+
| **3.0.0+** (Current) | **Xcode 26.0** | ✅ Full liquid glass effects with UIGlassEffect API<br/>✅ Enhanced SwiftUI implementation<br/>✅ All blur types and system materials |
|
|
310
|
+
| **2.1.0** | Xcode 16.0+ | ✅ Standard blur effects<br/>✅ System materials (iOS 13+)<br/>❌ No liquid glass effects |
|
|
311
|
+
|
|
312
|
+
### Xcode 26.0+ Compatibility Table
|
|
313
|
+
|
|
314
|
+
| Xcode Version | Library Compatibility | Features Available | Notes |
|
|
315
|
+
|---------------|----------------------|-------------------|-------|
|
|
316
|
+
| **Xcode 26.0+** | ✅ **Fully Supported** | ✅ All features including liquid glass effects<br/>✅ UIGlassEffect API<br/>✅ SwiftUI implementation<br/>✅ All blur types and system materials | **Recommended for current version** |
|
|
317
|
+
| **Xcode 16.x and below** | ❌ **Not Supported** | ❌ Liquid glass effects<br/>❌ UIGlassEffect API<br/>⚠️ Basic blur effects may work with limitations | Use library version 2.1.0 instead |
|
|
167
318
|
|
|
168
|
-
|
|
319
|
+
> ⚠️ **Critical Requirement**: The current version (3.0.0+) requires **Xcode 26.0 or higher** and will not work with older Xcode versions. This is a hard requirement due to the UIGlassEffect API and SwiftUI enhancements introduced in Xcode 26.0.
|
|
169
320
|
|
|
170
|
-
|
|
321
|
+
> 💡 **Migration Tip**: If you're unable to upgrade to Xcode 26.0, please use version **2.1.0** of this library which supports Xcode 16.0 and provides standard blur effects without liquid glass capabilities.
|
|
171
322
|
|
|
172
|
-
|
|
173
|
-
- ✅ **Old Architecture (Paper)**: Backward compatibility maintained
|
|
323
|
+
### Installation by Xcode Version
|
|
174
324
|
|
|
175
|
-
|
|
325
|
+
**For Xcode 26.0+:**
|
|
176
326
|
|
|
177
327
|
## Installation
|
|
178
328
|
|
|
@@ -289,16 +439,49 @@ function MyComponent() {
|
|
|
289
439
|
}
|
|
290
440
|
```
|
|
291
441
|
|
|
442
|
+
### Liquid Glass Usage (iOS 26+)
|
|
443
|
+
|
|
444
|
+
```tsx
|
|
445
|
+
import React from 'react';
|
|
446
|
+
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
447
|
+
|
|
448
|
+
function LiquidGlassComponent() {
|
|
449
|
+
return (
|
|
450
|
+
<BlurView
|
|
451
|
+
type="liquidGlass"
|
|
452
|
+
glassType="regular"
|
|
453
|
+
glassTintColor="#007AFF"
|
|
454
|
+
glassOpacity={0.8}
|
|
455
|
+
style={{
|
|
456
|
+
padding: 20,
|
|
457
|
+
borderRadius: 20,
|
|
458
|
+
}}
|
|
459
|
+
>
|
|
460
|
+
<Text>Beautiful liquid glass effect</Text>
|
|
461
|
+
</BlurView>
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
```
|
|
465
|
+
|
|
292
466
|
## Props
|
|
293
467
|
|
|
468
|
+
All props are optional and have sensible defaults.
|
|
469
|
+
|
|
294
470
|
| Prop | Type | Default | Description |
|
|
295
471
|
|------|------|---------|-------------|
|
|
296
|
-
| `
|
|
297
|
-
| `
|
|
298
|
-
| `
|
|
472
|
+
| `type` | `'blur' \| 'liquidGlass'` | `'blur'` | The type of effect to apply. **Note**: `'liquidGlass'` is iOS 26+ only, falls back to enhanced blur on Android |
|
|
473
|
+
| `blurType` | `BlurType` | `'xlight'` | The type of blur effect to apply |
|
|
474
|
+
| `blurAmount` | `number` | `10.0` | The intensity of the blur effect (0-100) |
|
|
475
|
+
| `glassType` | `GlassType` | `'clear'` | The type of glass effect |
|
|
476
|
+
| `glassTintColor` | `string` | `'clear'` | The tint color for glass effect |
|
|
477
|
+
| `glassOpacity` | `number` | `1.0` | The opacity of glass effect (0-1) |
|
|
478
|
+
| `isInteractive` | `boolean` | `true` | (iOS only) Controls whether the liquid glass effect is interactive. When `false`, the liquid glass effect will not react to touch or movement. Only applicable when `type` is `'liquidGlass'` and iOS 26+. |
|
|
479
|
+
| `reducedTransparencyFallbackColor` | `string` | `'#FFFFFF'` | Fallback color when reduced transparency is enabled |
|
|
299
480
|
| `style` | `ViewStyle` | `undefined` | Style object for the blur view |
|
|
300
481
|
| `children` | `ReactNode` | `undefined` | Child components to render inside the blur view |
|
|
301
482
|
|
|
483
|
+
> **Note**: The `BlurType` and `GlassType` are exported types from the library. See [Blur Types](#blur-types) section below for all available values.
|
|
484
|
+
|
|
302
485
|
## Blur Types
|
|
303
486
|
|
|
304
487
|
The following blur types are supported:
|
|
@@ -321,10 +504,17 @@ The following blur types are supported:
|
|
|
321
504
|
## Platform Differences
|
|
322
505
|
|
|
323
506
|
### iOS
|
|
324
|
-
On iOS, this component
|
|
507
|
+
On iOS, this component has been completely rewritten using **SwiftUI** for modern performance and features:
|
|
508
|
+
|
|
509
|
+
- **iOS 26+**: Uses native `UIGlassEffect` API for true liquid glass effects with customizable tint colors and opacity
|
|
510
|
+
- **iOS 13-25**: Uses enhanced `UIVisualEffectView` with precise blur intensity control
|
|
511
|
+
- **Older iOS**: Graceful fallback to standard blur effects
|
|
512
|
+
- **SwiftUI Integration**: Leverages SwiftUI's declarative UI for better performance and maintainability
|
|
325
513
|
|
|
326
514
|
### Android
|
|
327
|
-
On Android, the component uses the BlurView library to provide real blur effects with hardware acceleration. The implementation supports multiple blur algorithms and gracefully falls back to translucent overlay approximation on devices with limited graphics capabilities.
|
|
515
|
+
On Android, the component uses the BlurView library to provide real blur effects with hardware acceleration. The implementation supports multiple blur algorithms and gracefully falls back to translucent overlay approximation on devices with limited graphics capabilities.
|
|
516
|
+
|
|
517
|
+
**⚠️ Liquid Glass Limitation**: Liquid glass effects (`type="liquidGlass"`) are **iOS 26+ exclusive**. On Android, they automatically fall back to enhanced blur with tint overlay to approximate the visual effect.
|
|
328
518
|
|
|
329
519
|
## Accessibility
|
|
330
520
|
|
|
@@ -340,36 +530,85 @@ You can customize the fallback color using the `reducedTransparencyFallbackColor
|
|
|
340
530
|
This package includes full TypeScript definitions:
|
|
341
531
|
|
|
342
532
|
```tsx
|
|
343
|
-
import { BlurView, BlurType, BlurViewProps } from '@sbaiahmed1/react-native-blur';
|
|
533
|
+
import { BlurView, BlurType, GlassType, BlurViewProps } from '@sbaiahmed1/react-native-blur';
|
|
344
534
|
|
|
345
535
|
// BlurType is exported for type checking
|
|
346
536
|
const blurType: BlurType = 'systemMaterial';
|
|
347
537
|
|
|
538
|
+
// GlassType for liquid glass effects
|
|
539
|
+
const glassType: GlassType = 'regular';
|
|
540
|
+
|
|
348
541
|
// BlurViewProps for component props
|
|
349
542
|
interface MyComponentProps {
|
|
350
543
|
blurProps: BlurViewProps;
|
|
351
544
|
}
|
|
545
|
+
|
|
546
|
+
// Example with all liquid glass properties
|
|
547
|
+
const liquidGlassProps: BlurViewProps = {
|
|
548
|
+
type: 'liquidGlass',
|
|
549
|
+
glassType: 'regular',
|
|
550
|
+
glassTintColor: '#007AFF',
|
|
551
|
+
glassOpacity: 0.8,
|
|
552
|
+
};
|
|
352
553
|
```
|
|
353
554
|
|
|
354
555
|
## Example App
|
|
355
556
|
|
|
356
|
-
The package includes a comprehensive example app that demonstrates all blur types and
|
|
557
|
+
The package includes a comprehensive example app that demonstrates all blur types, liquid glass effects, and practical use cases. The example app features:
|
|
558
|
+
|
|
559
|
+
- **Main Demo**: Interactive blur type selector with live preview
|
|
560
|
+
- **Liquid Glass Examples**: Showcase of iOS 26+ glass effects with customizable properties
|
|
561
|
+
- **Practical Use Cases**: Real-world examples like cards, modals, and overlays
|
|
562
|
+
- **Comparison Views**: Side-by-side comparisons of different effects
|
|
563
|
+
|
|
564
|
+
To run the example:
|
|
357
565
|
|
|
358
566
|
```bash
|
|
359
567
|
cd example
|
|
360
|
-
|
|
568
|
+
yarn install
|
|
361
569
|
# For iOS
|
|
362
|
-
|
|
570
|
+
yarn ios
|
|
363
571
|
# For Android
|
|
364
|
-
|
|
572
|
+
yarn android
|
|
365
573
|
```
|
|
366
574
|
|
|
367
575
|
## Performance Considerations
|
|
368
576
|
|
|
369
|
-
- **iOS**:
|
|
577
|
+
- **iOS**:
|
|
578
|
+
- **SwiftUI Implementation**: Enhanced performance with declarative UI updates
|
|
579
|
+
- **Liquid Glass (iOS 26+)**: Hardware-accelerated glass effects with minimal performance impact
|
|
580
|
+
- **Blur Effects**: Native blur effects are hardware-accelerated and performant
|
|
581
|
+
- **Smart Fallbacks**: Automatic degradation ensures smooth performance on older devices
|
|
370
582
|
- **Android**: Real blur effects are hardware-accelerated with fallback to lightweight overlay when needed
|
|
371
|
-
- Avoid using too many blur views simultaneously on lower-end devices
|
|
583
|
+
- Avoid using too many blur/glass views simultaneously on lower-end devices
|
|
372
584
|
- Consider using `reducedTransparencyFallbackColor` for better accessibility
|
|
585
|
+
- Liquid glass effects automatically fall back to enhanced blur on Android and older iOS versions
|
|
586
|
+
|
|
587
|
+
## What's New in v0.3.0
|
|
588
|
+
|
|
589
|
+
### 🌊 Liquid Glass Effects (iOS 26+)
|
|
590
|
+
- Revolutionary glass effects using Apple's new UIGlassEffect API
|
|
591
|
+
- Customizable glass types: `clear` and `regular`
|
|
592
|
+
- Adjustable tint colors and opacity for stunning visual effects
|
|
593
|
+
- Automatic fallback to enhanced blur on older iOS versions and Android
|
|
594
|
+
|
|
595
|
+
### 🔄 SwiftUI Rewrite
|
|
596
|
+
- Complete iOS implementation rewritten using SwiftUI
|
|
597
|
+
- Enhanced performance with declarative UI updates
|
|
598
|
+
- Better integration with React Native's new architecture
|
|
599
|
+
- Improved blur intensity control with precise animation handling
|
|
600
|
+
|
|
601
|
+
### 📱 Enhanced Example App
|
|
602
|
+
- New liquid glass demonstration section
|
|
603
|
+
- Interactive property controls for real-time customization
|
|
604
|
+
- Practical use case examples (cards, modals, overlays)
|
|
605
|
+
- Comparison views for different effect types
|
|
606
|
+
|
|
607
|
+
### 🛠️ Developer Experience
|
|
608
|
+
- Full TypeScript support for all new properties
|
|
609
|
+
- Improved component layout handling
|
|
610
|
+
- Better accessibility support with smart fallbacks
|
|
611
|
+
- Enhanced documentation and examples
|
|
373
612
|
|
|
374
613
|
## Contributing
|
|
375
614
|
|
package/ReactNativeBlur.podspec
CHANGED
|
@@ -13,7 +13,8 @@ Pod::Spec.new do |s|
|
|
|
13
13
|
s.platforms = { :ios => min_ios_version_supported }
|
|
14
14
|
s.source = { :git => "https://github.com/sbaiahmed1/sbaiahmed1-react-native-blur.git", :tag => "#{s.version}" }
|
|
15
15
|
|
|
16
|
-
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
|
|
17
|
+
s.swift_version = '5.0'
|
|
17
18
|
s.private_header_files = "ios/**/*.h"
|
|
18
19
|
|
|
19
20
|
install_modules_dependencies(s)
|