@sbaiahmed1/react-native-blur 3.0.0-beta.1 → 3.1.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.
Files changed (23) hide show
  1. package/README.md +209 -107
  2. package/ReactNativeBlur.podspec +1 -0
  3. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerDelegate.java +18 -3
  4. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerInterface.java +6 -1
  5. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerDelegate.java +53 -0
  6. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerInterface.java +25 -0
  7. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.cpp +1 -1
  8. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.h +1 -1
  9. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h +1 -1
  10. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.cpp +17 -7
  11. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.h +55 -15
  12. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.cpp +1 -1
  13. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.h +7 -7
  14. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.h +3 -3
  15. package/ios/Helpers/BlurStyleHelpers.swift +59 -0
  16. package/ios/Helpers/ReactNativeBlurViewHelper.swift +59 -0
  17. package/ios/ReactNativeBlurView.mm +6 -1
  18. package/ios/ReactNativeBlurViewManager.m +6 -0
  19. package/ios/Views/AdvancedBlurView.swift +94 -0
  20. package/ios/Views/BasicColoredView.swift +58 -0
  21. package/ios/Views/BlurEffectView.swift +70 -0
  22. package/package.json +1 -1
  23. package/ios/ReactNativeBlurView.swift +0 -321
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @sbaiahmed1/react-native-blur
2
2
 
3
- A modern React Native blur view component that provides native blur effects and **liquid glass effects** for both iOS and Android platforms.
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/dm/@sbaiahmed1/react-native-blur?style=for-the-badge&color=green" alt="downloads" />
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>
@@ -16,25 +16,39 @@ A modern React Native blur view component that provides native blur effects and
16
16
  </p>
17
17
  </div>
18
18
 
19
- ## Liquid Glass Demo
19
+ ## Demo
20
20
 
21
21
  <div align="center">
22
- <img src="liquidGlass.gif" alt="Liquid Glass Demo" width="300" />
22
+ <img src="ios-blur-glass-demo.gif" alt="iOS Demo" width="300" />
23
+ <img src="android-blur-glass-demo.gif" alt="Android Demo" width="300" />
24
+
25
+ <br>
26
+ <em>iOS (left) and Android (right) blur effects in action</em>
23
27
  <br>
24
- <em>Liquid Glass effect in action</em>
28
+ <em>Liquid Glass effect in action (iOS 26+ only)</em>
29
+ <br>
30
+ <strong>⚠️ Android automatically falls back to enhanced blur with tint overlay</strong>
25
31
  </div>
26
32
 
27
- ## Blur Demo
33
+ ## Version Compatibility
28
34
 
29
- <div align="center">
30
- <img src="iOS-demo.gif" alt="iOS Demo" width="300" />
31
- <img src="android-demo.gif" alt="Android Demo" width="300" />
35
+ ### Xcode Requirements
32
36
 
33
- <br>
34
- <em>iOS (left) and Android (right) blur effects in action</em>
35
- </div>
37
+ | Library Version | Minimum Xcode Version | iOS Features Available |
38
+ |-----------------|----------------------|----------------------|
39
+ | **0.3.0+** (Current) | **Xcode 26.0** | ✅ Full liquid glass effects with UIGlassEffect API<br/>✅ Enhanced SwiftUI implementation<br/>✅ All blur types and system materials |
40
+ | **0.2.1** | Xcode 16.0+ | ✅ Standard blur effects<br/>✅ System materials (iOS 13+)<br/>❌ No liquid glass effects |
41
+
42
+ ### Xcode 26.0+ Compatibility Table
43
+
44
+ | Xcode Version | Library Compatibility | Features Available | Notes |
45
+ |---------------|----------------------|-------------------|-------|
46
+ | **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** |
47
+ | **Xcode 16.x and below** | ❌ **Not Supported** | ❌ Liquid glass effects<br/>❌ UIGlassEffect API<br/>⚠️ Basic blur effects may work with limitations | Use library version 0.2.1 instead |
36
48
 
49
+ > ⚠️ **Critical Requirement**: The current version (0.3.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.
37
50
 
51
+ > 💡 **Migration Tip**: If you're unable to upgrade to Xcode 26.0, please use version **0.2.1** of this library which supports Xcode 16.0 and provides standard blur effects without liquid glass capabilities.
38
52
 
39
53
  ## Features
40
54
 
@@ -54,143 +68,229 @@ A modern React Native blur view component that provides native blur effects and
54
68
 
55
69
  This section provides a detailed comparison between `@sbaiahmed1/react-native-blur` and other popular blur libraries in the React Native ecosystem.
56
70
 
57
- ### vs. [@react-native-community/blur](https://www.npmjs.com/package/@react-native-community/blur)
71
+ ### 🆚 vs. [@react-native-community/blur](https://www.npmjs.com/package/@react-native-community/blur)
58
72
 
59
73
  | Feature | @sbaiahmed1/react-native-blur | @react-native-community/blur |
60
74
  |------------------------------|-------------------------------------|---------------------------------------|
61
- | **New Architecture Support** | ✅ Full Fabric/Turbo Module support | ❌ Limited support (crashes on android |
62
- | **Android Real Blur** | ✅ Hardware-accelerated real blur (including liquid glass) | Hardware-accelerated real blur |
63
- | **iOS Blur Quality** | ✅ Native UIVisualEffectView | ✅ Native UIVisualEffectView |
64
- | **Liquid Glass Effects** | ✅ Full support (iOS 26+ UIGlassEffect & Android) | ❌ Not supported |
65
- | **TypeScript Support** | ✅ Full TypeScript definitions | ⚠️ Basic TypeScript support |
66
- | **Maintenance Status** | ✅ Actively maintained | ⚠️ Community-maintained |
67
- | **Bundle Size** | 🟡 Moderate (includes BlurView lib) | 🟡 Moderate (includes BlurView lib) |
68
- | **API Complexity** | ✅ Simple, intuitive API | Simple API |
69
- | **Performance** | ✅ Hardware-accelerated | 🟡 iOS: Good, Android: Limited |
70
- | **Accessibility** | ✅ Full reduced transparency support | ✅ Reduced transparency support |
71
- | **Documentation** | ✅ Comprehensive with examples | 🟡 Basic documentation |
72
-
73
- **Advantages of @sbaiahmed1/react-native-blur:**
74
- - **True Android Blur**: Unlike the community version which only provides semi-transparent overlays on Android, our library delivers real hardware-accelerated blur effects on both platforms, including liquid glass effects.
75
- - **Future-Ready**: Built from the ground up with React Native's new architecture (Fabric) in mind
76
- - **Modern Codebase**: Uses the latest development practices with Kotlin for Android
77
- - ** Uses Swift**: Use of Swift for iOS, ensuring modern and efficient native code
78
- - **Better Performance**: Hardware acceleration on both platforms ensures smooth rendering
79
- - **Active Development**: Regular updates and feature additions
75
+ | **🏗️ New Architecture Support** | ✅ Full Fabric/Turbo Module support | ❌ Limited support, crashes on Android |
76
+ | **🤖 Android Real Blur** | ✅ Hardware-accelerated real blur + liquid glass | Hardware-accelerated real blur |
77
+ | **🍎 iOS Blur Quality** | ✅ Native UIVisualEffectView + UIGlassEffect | ✅ Native UIVisualEffectView only |
78
+ | **💎 Liquid Glass Effects** | ✅ Full support (iOS 26+ UIGlassEffect & Android) | ❌ Not supported |
79
+ | **📝 TypeScript Support** | ✅ Complete TypeScript definitions with IntelliSense | ⚠️ Basic TypeScript support |
80
+ | **🔧 Maintenance Status** | ✅ Actively maintained | ⚠️ Community-maintained, slower updates |
81
+ | **📦 Bundle Size** | 🟡 Moderate (includes native blur libs) | 🟡 Moderate (includes BlurView lib) |
82
+ | **🎯 API Design** | ✅ Modern, intuitive API with smart defaults | 🟡 Legacy API design |
83
+ | **⚡ Performance** | ✅ Hardware-accelerated on both platforms | Hardware-accelerated on both platforms |
84
+ | **♿ Accessibility** | ✅ Full reduced transparency + motion support | ✅ Basic reduced transparency support |
85
+ | **📚 Documentation** | ✅ Comprehensive guides + live examples | 🟡 Basic README documentation |
86
+ | **🎨 Blur Types** | ✅ iOS system materials + custom Android effects | ✅ iOS blur types (including iOS 13 materials) |
87
+ | **🔧 Android Blur Methods** | Native hardware-accelerated blur | ✅ Native hardware-accelerated blur |
88
+ | **📱 Platform Support** | iOS, Android with feature parity | iOS (full), Android (limited overlay) |
89
+
90
+ **🚀 Why Choose @sbaiahmed1/react-native-blur:**
91
+
92
+ - **🎯 Revolutionary Android Experience**: First library to bring **real hardware-accelerated blur** to Android, including liquid glass effects. No more fake transparency overlays!
93
+ - **💎 Liquid Glass Pioneer**: Only library supporting iOS 26+ UIGlassEffect API for stunning liquid glass materials on both platforms
94
+ - **🏗️ Future-Proof Architecture**: Built exclusively for React Native's new architecture (Fabric/Turbo Modules) - no legacy baggage
95
+ - **⚡ Superior Performance**: Hardware acceleration on both platforms with GPU-optimized rendering pipelines
96
+ - **🔧 Modern Development**: Swift for iOS, Kotlin for Android - leveraging the latest native technologies
97
+ - **📈 Active Innovation**: Regular feature updates, performance improvements, and new blur effects
80
98
 
81
99
  **When to choose @react-native-community/blur:**
82
- - If you need a battle-tested library with extensive community usage
83
- - If bundle size is a critical concern
84
- - If you're working with older React Native versions
100
+ - Legacy projects that can't upgrade to new architecture
101
+ - iOS-only applications where Android blur quality isn't important
102
+ - Projects requiring maximum stability over cutting-edge features
85
103
 
86
- ### vs. [expo-blur](https://www.npmjs.com/package/expo-blur)
104
+ ### 🆚 vs. [expo-blur](https://docs.expo.dev/versions/latest/sdk/blur-view/)
87
105
 
88
106
  | Feature | @sbaiahmed1/react-native-blur | expo-blur |
89
107
  |---------|------------------------------|----------|
90
- | **Expo Dependency** | ✅ No Expo required | ❌ Requires Expo SDK |
91
- | **Bare React Native** | ✅ Works with any RN project | ⚠️ Requires Expo configuration |
92
- | **Android Support** | ✅ Real blur effects | Semi-transparent view only |
93
- | **iOS Support** | ✅ Full native blur support | ✅ Full native blur support |
94
- | **Liquid Glass Effects** | ✅ Full support (iOS 26+ UIGlassEffect & Android) | ❌ Not supported |
95
- | **Bundle Size** | 🟡 Moderate | ✅ Lightweight (when using Expo) |
96
- | **Setup Complexity** | ✅ Simple npm install | 🟡 Requires Expo setup |
97
- | **Customization** | ✅ Extensive blur type options | 🟡 Limited blur types |
98
- | **New Architecture** | ✅ Full Fabric support | ✅ Expo handles compatibility |
99
- | **Development Experience** | ✅ Standard RN development | ✅ Excellent with Expo tools |
100
- | **Production Flexibility** | ✅ Any deployment method | 🟡 Expo-specific deployment |
101
-
102
- **Advantages of @sbaiahmed1/react-native-blur:**
103
- - **No Vendor Lock-in**: Works with any React Native project without requiring Expo ecosystem
104
- - **Real Android Blur**: Provides actual blur effects on Android, not just transparency, including liquid glass effects.
105
- - **Flexibility**: Can be used in brownfield apps, custom native modules, and any deployment scenario
106
- - **More Blur Types**: Extensive support for iOS system materials and custom blur types
107
- - **Direct Control**: Full control over native implementation without abstraction layers
108
+ | **🚫 Expo Dependency** | ✅ Zero dependencies on Expo ecosystem | ❌ Requires Expo SDK + managed workflow |
109
+ | **📱 Bare React Native** | ✅ Works with any RN project out-of-the-box | ⚠️ Complex setup for bare RN projects |
110
+ | **🤖 Android Support** | ✅ Real hardware-accelerated blur + liquid glass | ⚠️ Simple overlay + Experimental blur (experimentalBlurMethod prop) |
111
+ | **🍎 iOS Support** | ✅ Full native blur + UIGlassEffect (iOS 26+) | ✅ Native UIVisualEffectView support |
112
+ | **💎 Liquid Glass Effects** | ✅ Full support (iOS 26+ UIGlassEffect & Android) | ❌ Not supported, no plans to add |
113
+ | **📦 Bundle Size** | 🟡 Moderate (includes native libs) | ✅ Lightweight (when using Expo managed) |
114
+ | **⚙️ Setup Complexity** | ✅ Simple `npm install` + auto-linking | 🟡 Requires Expo development build setup |
115
+ | **🎨 Blur Types** | ✅ iOS system materials + custom Android effects | iOS tint types (light, dark, system materials) |
116
+ | **🎯 API Design** | ✅ `blurAmount` + `blurType` for precise control | ✅ `intensity` + `tint` (simple but limited) |
117
+ | **🏗️ New Architecture** | ✅ Native Fabric/Turbo Module support | ✅ Expo handles compatibility layer |
118
+ | **👨‍💻 Development Experience** | ✅ Standard RN development workflow | Excellent with Expo CLI tools |
119
+ | **🚀 Production Flexibility** | ✅ Any deployment method (CodePush, OTA, stores) | 🟡 Limited to Expo/EAS deployment |
120
+ | **🔧 Native Module Integration** | ✅ Easy integration with other native modules | ⚠️ May conflict with Expo managed workflow |
121
+ | **🤖 Android Blur Quality** | ✅ Hardware-accelerated real blur | Experimental (dimezisBlurView or none fallback) |
122
+
123
+ **🚀 Why Choose @sbaiahmed1/react-native-blur:**
124
+
125
+ - **🔓 No Vendor Lock-in**: Complete freedom from Expo ecosystem - works with any React Native setup
126
+ - **🎯 Revolutionary Android**: First library to deliver **real blur effects** on Android, not fake transparency tricks
127
+ - **💎 Liquid Glass Innovation**: Exclusive support for cutting-edge liquid glass materials on both platforms
128
+ - **🏢 Enterprise Ready**: Perfect for brownfield apps, custom native modules, and complex deployment scenarios
129
+ - **🎨 Advanced Customization**: 15+ iOS system materials plus custom Android blur implementations
130
+ - **⚡ Direct Performance**: No abstraction layers - direct access to native blur APIs for maximum performance
131
+ - **🔧 Developer Freedom**: Use any build system, deployment method, or native module without restrictions
108
132
 
109
133
  **When to choose expo-blur:**
110
- - If you're already using Expo and want ecosystem consistency
111
- - If you prefer Expo's managed workflow and tooling
112
- - If you only need basic blur effects and iOS-focused functionality
113
- - If you want the simplicity of Expo's managed dependencies
134
+ - Already deeply invested in Expo managed workflow
135
+ - Building simple apps with basic blur needs (iOS-focused)
136
+ - Prefer Expo's managed dependency system over manual configuration
137
+ - Don't need advanced blur effects or Android blur quality
114
138
 
115
- ### Performance Comparison
139
+ ### Performance Comparison
116
140
 
117
141
  | Metric | @sbaiahmed1/react-native-blur | @react-native-community/blur | expo-blur |
118
142
  |--------|------------------------------|------------------------------|----------|
119
- | **iOS Rendering** | Hardware-accelerated | Hardware-accelerated | Hardware-accelerated |
120
- | **Android Rendering** | Hardware-accelerated real blur | Software overlay | Software overlay |
121
- | **Memory Usage** | Optimized with BlurView | Low | Low |
122
- | **CPU Impact** | Low (GPU-based) | iOS: Low, Android: Minimal | iOS: Low, Android: Minimal |
123
- | **Frame Rate Impact** | Minimal on both platforms | iOS: Minimal, Android: None | iOS: Minimal, Android: None |
143
+ | **🍎 iOS Rendering** | Hardware-accelerated UIVisualEffect + UIGlassEffect | Hardware-accelerated UIVisualEffect | Hardware-accelerated UIVisualEffect |
144
+ | **🤖 Android Rendering** | **Hardware-accelerated real blur** | **Hardware-accelerated real blur** | Software overlay (fake blur) |
145
+ | **🧠 Memory Usage** | Optimized with native BlurView libs | Optimized with native BlurView libs | Low (no real Android blur) |
146
+ | **⚙️ CPU Impact** | Low (GPU-based on both platforms) | iOS: Low, Android: Minimal (no blur) | iOS: Low, Android: Minimal (no blur) |
147
+ | **📊 Frame Rate Impact** | Minimal impact on both platforms | iOS: Minimal, Android: None (no blur) | iOS: Minimal, Android: None (no blur) |
148
+ | **🎯 Blur Quality** | **Excellent on both platforms** | iOS: Excellent, Android: Poor | iOS: Good, Android: Poor |
149
+ | **💎 Liquid Glass Performance** | **Native UIGlassEffect + Android equivalent** | ❌ Not available | ❌ Not available |
150
+ | **🚀 New Architecture Performance** | **Optimized for Fabric/Turbo Modules** | Limited compatibility | Expo abstraction layer |
124
151
 
125
- ### Community & Support
152
+ ### 🤝 Community & Support
126
153
 
127
154
  | Aspect | @sbaiahmed1/react-native-blur | @react-native-community/blur | expo-blur |
128
155
  |--------|------------------------------|------------------------------|----------|
129
- | **GitHub Stars** | 🆕 Growing | 🌟 Established (3.8k+) | 🌟 Part of Expo ecosystem |
130
- | **Issue Response** | ✅ Active maintainer | 🟡 Community-driven | ✅ Expo team support |
131
- | **Documentation Quality** | ✅ Comprehensive | 🟡 Basic | ✅ Excellent (Expo docs) |
132
- | **Update Frequency** | ✅ Regular updates | 🟡 Sporadic | ✅ Regular (with Expo releases) |
133
- | **Breaking Changes** | ✅ Semantic versioning | ⚠️ Occasional | ✅ Managed by Expo |
156
+ | **⭐ GitHub Stars** | 🆕 Growing rapidly (new innovative features) | 🌟 Established (3.8k+, legacy codebase) | 🌟 Part of Expo ecosystem |
157
+ | **🎯 Issue Response** | ✅ **Active core maintainer** (< 24h response) | 🟡 Community-driven (slow response) | ✅ Expo team support |
158
+ | **📚 Documentation Quality** | ✅ **Comprehensive guides + live examples** | 🟡 Basic README only | ✅ Good (Expo docs) |
159
+ | **🔄 Update Frequency** | ✅ **Regular feature updates** (weekly/monthly) | 🟡 Sporadic maintenance updates | ✅ Regular (with Expo releases) |
160
+ | **💔 Breaking Changes** | ✅ **Strict semantic versioning** | ⚠️ Occasional unannounced changes | ✅ Managed by Expo |
161
+ | **🐛 Bug Fixes** | ✅ **Rapid fixes** (same-day for critical issues) | 🟡 Depends on community availability | ✅ Good (Expo team) |
162
+ | **💡 Feature Requests** | ✅ **Actively considered** (roadmap-driven) | 🟡 Limited by maintainer capacity | 🟡 Limited to Expo priorities |
163
+ | **🔧 Technical Support** | ✅ **Direct maintainer support** | 🟡 Community forums only | ✅ Expo Discord/forums |
134
164
 
135
- ### Migration Guide
165
+ ### 🔄 Migration Guide
136
166
 
137
- #### From @react-native-community/blur
167
+ #### 🚀 From @react-native-community/blur
138
168
 
139
169
  ```tsx
140
- // Before
170
+ // Before - Limited Android support
141
171
  import { BlurView } from '@react-native-community/blur';
142
172
 
143
- // After
173
+ <BlurView
174
+ style={styles.absolute}
175
+ blurType="light" // Limited to iOS blur types only
176
+ blurAmount={10} // Max 32 on Android (clamped)
177
+ reducedTransparencyFallbackColor="white"
178
+ />
179
+
180
+ // After - Full platform support + liquid glass
144
181
  import { BlurView } from '@sbaiahmed1/react-native-blur';
145
182
 
146
- // API is largely compatible, main differences:
147
- // - Better Android blur quality
148
- // - Additional iOS system material types
149
- // - Improved TypeScript support
183
+ <BlurView
184
+ style={styles.absolute}
185
+ blurType="light" // Same API!
186
+ blurAmount={10} // No Android limitations
187
+ reducedTransparencyFallbackColor="white"
188
+ // NEW: Liquid glass support
189
+ type="liquidGlass" // Enable liquid glass effects
190
+ glassType="regular" // iOS 26+ UIGlassEffect styles
191
+ glassTintColor="#007AFF" // Glass tint color
192
+ glassOpacity={0.8} // Glass opacity (0-1)
193
+ />
150
194
  ```
151
195
 
152
- #### From expo-blur
196
+ **✨ Migration Benefits:**
197
+ - **🎯 Zero Breaking Changes**: Drop-in replacement with same API
198
+ - **🤖 Real Android Blur**: Instantly get hardware-accelerated blur on Android
199
+ - **💎 Liquid Glass Bonus**: Add cutting-edge liquid glass effects with one prop
200
+ - **⚡ Better Performance**: Hardware acceleration on both platforms
201
+ - **🏗️ Future-Proof**: Built for React Native's new architecture
202
+
203
+ #### 🚀 From expo-blur
153
204
 
154
205
  ```tsx
155
- // Before
206
+ // Before - Expo dependency + limited Android
156
207
  import { BlurView } from 'expo-blur';
157
208
 
158
- // After
209
+ <BlurView
210
+ intensity={50} // 0-100 intensity scale
211
+ tint="light" // light, dark, default, system materials
212
+ experimentalBlurMethod="dimezisBlurView" // Android experimental blur
213
+ style={styles.absolute}
214
+ >
215
+ <Text>Content</Text>
216
+ </BlurView>
217
+
218
+ // After - No dependencies + real Android blur
159
219
  import { BlurView } from '@sbaiahmed1/react-native-blur';
160
220
 
161
- // Key differences:
162
- // - More blur type options available
163
- // - Real Android blur instead of transparency
164
- // - No Expo dependency required
221
+ <BlurView
222
+ blurAmount={50} // intensity blurAmount (same scale)
223
+ blurType="light" // tint blurType (same options + more)
224
+ style={styles.absolute}
225
+ // NEW: Advanced features
226
+ type="liquidGlass" // Liquid glass effects
227
+ glassType="regular" // iOS 26+ materials
228
+ glassTintColor="#007AFF" // Glass tint color
229
+ glassOpacity={0.8} // Glass opacity (0-1)
230
+ isInteractive={true} // Touch interaction support
231
+ // No experimental props needed - real blur by default
232
+ >
233
+ <Text>Content</Text>
234
+ </BlurView>
165
235
  ```
166
236
 
237
+ **✨ Migration Benefits:**
238
+ - **🔓 No Vendor Lock-in**: Remove Expo dependency completely
239
+ - **🎯 Real Android Blur**: Get actual blur effects, not fake transparency
240
+ - **💎 Liquid Glass Effects**: Access to cutting-edge iOS 26+ materials
241
+ - **🚀 Deployment Freedom**: Use any build system or deployment method
242
+ - **🎨 More Customization**: 15+ blur types vs basic intensity control
243
+
244
+ #### 🛠️ Quick Migration Checklist
245
+
246
+ 1. **Install the library:**
247
+ ```bash
248
+ npm uninstall @react-native-community/blur expo-blur
249
+ npm install @sbaiahmed1/react-native-blur
250
+ ```
251
+
252
+ 2. **Update imports:**
253
+ ```tsx
254
+ // Replace old imports
255
+ import { BlurView } from '@sbaiahmed1/react-native-blur';
256
+ ```
257
+
258
+ 3. **Optional: Add liquid glass effects:**
259
+ ```tsx
260
+ <BlurView
261
+ type="liquidGlass"
262
+ glassType="regular"
263
+ glassTintColor="#007AFF"
264
+ glassOpacity={0.8}
265
+ />
266
+ ```
267
+
268
+ 4. **Test on Android:** Experience real blur effects for the first time! 🎉
269
+
167
270
  ### Recommendation
168
271
 
169
272
  **Choose @sbaiahmed1/react-native-blur if:**
170
- - You want real blur effects on Android, including liquid glass effects.
171
- - You're building for the new React Native architecture
172
- - You need maximum flexibility and don't want vendor lock-in
173
- - You want the latest performance optimizations
174
- - You're starting a new project or can afford migration time
273
+ - You need **real blur effects on Android** (not experimental/fallback methods)
274
+ - You want **liquid glass effects** for modern iOS apps (iOS 26+)
275
+ - You're building with **React Native's new architecture** (Fabric/Turbo Modules)
276
+ - You need **maximum performance** on both platforms
277
+ - You want **comprehensive TypeScript support** with IntelliSense
278
+ - You prefer **modern API design** with intuitive prop names
279
+ - You need **unlimited blur intensity** on Android (no 32-unit clamp)
175
280
 
176
281
  **Choose @react-native-community/blur if:**
177
- - You have an existing project that works well with it
178
- - Bundle size is critical and Android blur quality is not important
179
- - You need maximum stability and community testing
282
+ - You're working with **legacy React Native projects** (< 0.68)
283
+ - You need **battle-tested stability** over cutting-edge features
284
+ - Your app **primarily targets iOS** (where it performs excellently)
285
+ - You can accept **limited Android blur quality** (overlay-based)
286
+ - You prefer **community-driven** open source projects
180
287
 
181
288
  **Choose expo-blur if:**
182
- - You're already committed to the Expo ecosystem
183
- - You only need iOS blur effects
184
- - You prefer managed dependencies and simplified setup
185
-
186
- ## Architecture Compatibility
187
-
188
- This library is fully compatible with both React Native architectures:
189
-
190
- - ✅ **New Architecture (Fabric)**: Full support with Turbo Modules
191
- - ✅ **Old Architecture (Paper)**: Backward compatibility maintained
192
-
193
- Both architectures have been tested and work perfectly without any additional configuration required.
289
+ - You're already **committed to the Expo ecosystem**
290
+ - You're building **simple apps** with basic blur needs
291
+ - You want **zero native configuration** (Expo managed workflow)
292
+ - **Bundle size** is your primary concern
293
+ - You can accept **experimental Android blur** with potential fallbacks
194
294
 
195
295
  ## Installation
196
296
 
@@ -337,7 +437,7 @@ All props are optional and have sensible defaults.
337
437
 
338
438
  | Prop | Type | Default | Description |
339
439
  |------|------|---------|-------------|
340
- | `type` | `'blur' \| 'liquidGlass'` | `'blur'` | The type of effect to apply |
440
+ | `type` | `'blur' \| 'liquidGlass'` | `'blur'` | The type of effect to apply. **Note**: `'liquidGlass'` is iOS 26+ only, falls back to enhanced blur on Android |
341
441
  | `blurType` | `BlurType` | `'xlight'` | The type of blur effect to apply |
342
442
  | `blurAmount` | `number` | `10.0` | The intensity of the blur effect (0-100) |
343
443
  | `glassType` | `GlassType` | `'clear'` | The type of glass effect |
@@ -380,7 +480,9 @@ On iOS, this component has been completely rewritten using **SwiftUI** for moder
380
480
  - **SwiftUI Integration**: Leverages SwiftUI's declarative UI for better performance and maintainability
381
481
 
382
482
  ### Android
383
- 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. Liquid glass effects fall back to enhanced blur with tint overlay.
483
+ 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.
484
+
485
+ **⚠️ 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.
384
486
 
385
487
  ## Accessibility
386
488
 
@@ -15,6 +15,7 @@ Pod::Spec.new do |s|
15
15
 
16
16
  s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17
17
  s.swift_version = '5.0'
18
+ s.module_name = "ReactNativeBlur"
18
19
  s.private_header_files = "ios/**/*.h"
19
20
 
20
21
  install_modules_dependencies(s)
@@ -22,14 +22,29 @@ public class ReactNativeBlurViewManagerDelegate<T extends View, U extends BaseVi
22
22
  @Override
23
23
  public void setProperty(T view, String propName, @Nullable Object value) {
24
24
  switch (propName) {
25
- case "blurType":
26
- mViewManager.setBlurType(view, (String) value);
25
+ case "glassTintColor":
26
+ mViewManager.setGlassTintColor(view, value == null ? "clear" : (String) value);
27
+ break;
28
+ case "glassOpacity":
29
+ mViewManager.setGlassOpacity(view, value == null ? 1f : ((Double) value).doubleValue());
27
30
  break;
28
31
  case "blurAmount":
29
32
  mViewManager.setBlurAmount(view, value == null ? 10f : ((Double) value).doubleValue());
30
33
  break;
34
+ case "type":
35
+ mViewManager.setType(view, (String) value);
36
+ break;
37
+ case "blurType":
38
+ mViewManager.setBlurType(view, (String) value);
39
+ break;
40
+ case "glassType":
41
+ mViewManager.setGlassType(view, (String) value);
42
+ break;
31
43
  case "reducedTransparencyFallbackColor":
32
- mViewManager.setReducedTransparencyFallbackColor(view, value == null ? null : (String) value);
44
+ mViewManager.setReducedTransparencyFallbackColor(view, value == null ? "#FFFFFF" : (String) value);
45
+ break;
46
+ case "isInteractive":
47
+ mViewManager.setIsInteractive(view, value == null ? true : (boolean) value);
33
48
  break;
34
49
  default:
35
50
  super.setProperty(view, propName, value);
@@ -14,7 +14,12 @@ import androidx.annotation.Nullable;
14
14
  import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
15
15
 
16
16
  public interface ReactNativeBlurViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
17
- void setBlurType(T view, @Nullable String value);
17
+ void setGlassTintColor(T view, @Nullable String value);
18
+ void setGlassOpacity(T view, double value);
18
19
  void setBlurAmount(T view, double value);
20
+ void setType(T view, @Nullable String value);
21
+ void setBlurType(T view, @Nullable String value);
22
+ void setGlassType(T view, @Nullable String value);
19
23
  void setReducedTransparencyFallbackColor(T view, @Nullable String value);
24
+ void setIsInteractive(T view, boolean value);
20
25
  }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GeneratePropsJavaDelegate.js
8
+ */
9
+
10
+ package com.facebook.react.viewmanagers;
11
+
12
+ import android.view.View;
13
+ import androidx.annotation.Nullable;
14
+ import com.facebook.react.uimanager.BaseViewManager;
15
+ import com.facebook.react.uimanager.BaseViewManagerDelegate;
16
+ import com.facebook.react.uimanager.LayoutShadowNode;
17
+
18
+ public class ReactNativeGlassEffectContainerManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ReactNativeGlassEffectContainerManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
19
+ public ReactNativeGlassEffectContainerManagerDelegate(U viewManager) {
20
+ super(viewManager);
21
+ }
22
+ @Override
23
+ public void setProperty(T view, String propName, @Nullable Object value) {
24
+ switch (propName) {
25
+ case "glassType":
26
+ mViewManager.setGlassType(view, (String) value);
27
+ break;
28
+ case "glassTintColor":
29
+ mViewManager.setGlassTintColor(view, value == null ? "clear" : (String) value);
30
+ break;
31
+ case "glassOpacity":
32
+ mViewManager.setGlassOpacity(view, value == null ? 1f : ((Double) value).doubleValue());
33
+ break;
34
+ case "isInteractive":
35
+ mViewManager.setIsInteractive(view, value == null ? true : (boolean) value);
36
+ break;
37
+ case "spacing":
38
+ mViewManager.setSpacing(view, value == null ? 8f : ((Double) value).doubleValue());
39
+ break;
40
+ case "enableMorphing":
41
+ mViewManager.setEnableMorphing(view, value == null ? true : (boolean) value);
42
+ break;
43
+ case "morphingDuration":
44
+ mViewManager.setMorphingDuration(view, value == null ? 300 : ((Double) value).intValue());
45
+ break;
46
+ case "reducedTransparencyFallbackColor":
47
+ mViewManager.setReducedTransparencyFallbackColor(view, value == null ? "#FFFFFF" : (String) value);
48
+ break;
49
+ default:
50
+ super.setProperty(view, propName, value);
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GeneratePropsJavaInterface.js
8
+ */
9
+
10
+ package com.facebook.react.viewmanagers;
11
+
12
+ import android.view.View;
13
+ import androidx.annotation.Nullable;
14
+ import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
15
+
16
+ public interface ReactNativeGlassEffectContainerManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
17
+ void setGlassType(T view, @Nullable String value);
18
+ void setGlassTintColor(T view, @Nullable String value);
19
+ void setGlassOpacity(T view, double value);
20
+ void setIsInteractive(T view, boolean value);
21
+ void setSpacing(T view, double value);
22
+ void setEnableMorphing(T view, boolean value);
23
+ void setMorphingDuration(T view, int value);
24
+ void setReducedTransparencyFallbackColor(T view, @Nullable String value);
25
+ }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  void ReactNativeBlurViewSpec_registerComponentDescriptorsFromCodegen(
18
18
  std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
19
19
  registry->add(concreteComponentDescriptorProvider<ReactNativeBlurViewComponentDescriptor>());
20
- registry->add(concreteComponentDescriptorProvider<ReactNativeGlassViewComponentDescriptor>());
20
+ registry->add(concreteComponentDescriptorProvider<ReactNativeGlassEffectContainerComponentDescriptor>());
21
21
  }
22
22
 
23
23
  } // namespace facebook::react
@@ -17,7 +17,7 @@
17
17
  namespace facebook::react {
18
18
 
19
19
  using ReactNativeBlurViewComponentDescriptor = ConcreteComponentDescriptor<ReactNativeBlurViewShadowNode>;
20
- using ReactNativeGlassViewComponentDescriptor = ConcreteComponentDescriptor<ReactNativeGlassViewShadowNode>;
20
+ using ReactNativeGlassEffectContainerComponentDescriptor = ConcreteComponentDescriptor<ReactNativeGlassEffectContainerShadowNode>;
21
21
 
22
22
  void ReactNativeBlurViewSpec_registerComponentDescriptorsFromCodegen(
23
23
  std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
@@ -20,7 +20,7 @@ class ReactNativeBlurViewEventEmitter : public ViewEventEmitter {
20
20
 
21
21
 
22
22
  };
23
- class ReactNativeGlassViewEventEmitter : public ViewEventEmitter {
23
+ class ReactNativeGlassEffectContainerEventEmitter : public ViewEventEmitter {
24
24
  public:
25
25
  using ViewEventEmitter::ViewEventEmitter;
26
26
 
@@ -19,18 +19,28 @@ ReactNativeBlurViewProps::ReactNativeBlurViewProps(
19
19
  const ReactNativeBlurViewProps &sourceProps,
20
20
  const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
21
21
 
22
- blurType(convertRawProp(context, rawProps, "blurType", sourceProps.blurType, {ReactNativeBlurViewBlurType::Light})),
22
+ glassTintColor(convertRawProp(context, rawProps, "glassTintColor", sourceProps.glassTintColor, {"clear"})),
23
+ glassOpacity(convertRawProp(context, rawProps, "glassOpacity", sourceProps.glassOpacity, {1.0})),
23
24
  blurAmount(convertRawProp(context, rawProps, "blurAmount", sourceProps.blurAmount, {10.0})),
24
- reducedTransparencyFallbackColor(convertRawProp(context, rawProps, "reducedTransparencyFallbackColor", sourceProps.reducedTransparencyFallbackColor, {}))
25
+ type(convertRawProp(context, rawProps, "type", sourceProps.type, {ReactNativeBlurViewType::Blur})),
26
+ blurType(convertRawProp(context, rawProps, "blurType", sourceProps.blurType, {ReactNativeBlurViewBlurType::Xlight})),
27
+ glassType(convertRawProp(context, rawProps, "glassType", sourceProps.glassType, {ReactNativeBlurViewGlassType::Clear})),
28
+ reducedTransparencyFallbackColor(convertRawProp(context, rawProps, "reducedTransparencyFallbackColor", sourceProps.reducedTransparencyFallbackColor, {"#FFFFFF"})),
29
+ isInteractive(convertRawProp(context, rawProps, "isInteractive", sourceProps.isInteractive, {true}))
25
30
  {}
26
- ReactNativeGlassViewProps::ReactNativeGlassViewProps(
31
+ ReactNativeGlassEffectContainerProps::ReactNativeGlassEffectContainerProps(
27
32
  const PropsParserContext &context,
28
- const ReactNativeGlassViewProps &sourceProps,
33
+ const ReactNativeGlassEffectContainerProps &sourceProps,
29
34
  const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
30
35
 
31
- glassType(convertRawProp(context, rawProps, "glassType", sourceProps.glassType, {ReactNativeGlassViewGlassType::Default})),
32
- glassAmount(convertRawProp(context, rawProps, "glassAmount", sourceProps.glassAmount, {50.0})),
33
- reducedTransparencyFallbackColor(convertRawProp(context, rawProps, "reducedTransparencyFallbackColor", sourceProps.reducedTransparencyFallbackColor, {}))
36
+ glassType(convertRawProp(context, rawProps, "glassType", sourceProps.glassType, {ReactNativeGlassEffectContainerGlassType::Clear})),
37
+ glassTintColor(convertRawProp(context, rawProps, "glassTintColor", sourceProps.glassTintColor, {"clear"})),
38
+ glassOpacity(convertRawProp(context, rawProps, "glassOpacity", sourceProps.glassOpacity, {1.0})),
39
+ isInteractive(convertRawProp(context, rawProps, "isInteractive", sourceProps.isInteractive, {true})),
40
+ spacing(convertRawProp(context, rawProps, "spacing", sourceProps.spacing, {8.0})),
41
+ enableMorphing(convertRawProp(context, rawProps, "enableMorphing", sourceProps.enableMorphing, {true})),
42
+ morphingDuration(convertRawProp(context, rawProps, "morphingDuration", sourceProps.morphingDuration, {300})),
43
+ reducedTransparencyFallbackColor(convertRawProp(context, rawProps, "reducedTransparencyFallbackColor", sourceProps.reducedTransparencyFallbackColor, {"#FFFFFF"}))
34
44
  {}
35
45
 
36
46
  } // namespace facebook::react