@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.
- package/README.md +209 -107
- package/ReactNativeBlur.podspec +1 -0
- 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/ios/Helpers/BlurStyleHelpers.swift +59 -0
- package/ios/Helpers/ReactNativeBlurViewHelper.swift +59 -0
- package/ios/ReactNativeBlurView.mm +6 -1
- package/ios/ReactNativeBlurViewManager.m +6 -0
- package/ios/Views/AdvancedBlurView.swift +94 -0
- package/ios/Views/BasicColoredView.swift +58 -0
- package/ios/Views/BlurEffectView.swift +70 -0
- package/package.json +1 -1
- 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
|
|
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>
|
|
@@ -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
|
-
##
|
|
19
|
+
## Demo
|
|
20
20
|
|
|
21
21
|
<div align="center">
|
|
22
|
-
<img src="
|
|
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
|
-
##
|
|
33
|
+
## Version Compatibility
|
|
28
34
|
|
|
29
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
73
|
-
**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
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
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
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://
|
|
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
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
| **
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
102
|
-
**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
-
|
|
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
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
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
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
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
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
147
|
-
|
|
148
|
-
//
|
|
149
|
-
//
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
|
|
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
|
|
171
|
-
- You
|
|
172
|
-
- You
|
|
173
|
-
- You
|
|
174
|
-
- You
|
|
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
|
|
178
|
-
-
|
|
179
|
-
-
|
|
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
|
|
184
|
-
- You
|
|
185
|
-
|
|
186
|
-
|
|
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.
|
|
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
|
|
package/ReactNativeBlur.podspec
CHANGED
|
@@ -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 "
|
|
26
|
-
mViewManager.
|
|
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 ?
|
|
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
|
|
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<
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
31
|
+
ReactNativeGlassEffectContainerProps::ReactNativeGlassEffectContainerProps(
|
|
27
32
|
const PropsParserContext &context,
|
|
28
|
-
const
|
|
33
|
+
const ReactNativeGlassEffectContainerProps &sourceProps,
|
|
29
34
|
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
30
35
|
|
|
31
|
-
glassType(convertRawProp(context, rawProps, "glassType", sourceProps.glassType, {
|
|
32
|
-
|
|
33
|
-
|
|
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
|