
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
blur-react-native
Advanced tools
A powerful React Native library that provides native blur effects for both iOS and Android. Create beautiful, performant blur overlays with various blur types and customization options.
npm install blur-react-native
Or with yarn:
yarn add blur-react-native
For React Native 0.60 and above, the library will be automatically linked. You just need to install the pods:
cd ios && pod install
If you're using an older version of React Native, you'll need to manually link the library:
cd ios && pod install
Podfile
:pod 'JellifyBlur', :path => '../node_modules/blur-react-native'
pod install
For React Native 0.60+, the Android library will be automatically linked. No additional setup is required.
If you're using an older version of React Native:
android/settings.gradle
:include ':blur-react-native'
project(':blur-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/blur-react-native/android')
android/app/build.gradle
:dependencies {
implementation project(':blur-react-native')
}
MainApplication.java
:import com.riteshshukla.jellifyblur.JellifyBlurViewPackage;
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new JellifyBlurViewPackage() // Add this line
);
}
The library automatically chooses the best blur implementation based on the Android API level:
RenderEffect
for hardware-accelerated blurRenderScript
with ScriptIntrinsicBlur
for GPU-accelerated blurimport React from 'react';
import { View, Text } from 'react-native';
import { BlurView } from 'blur-react-native';
export default function App() {
return (
<View style={{ flex: 1 }}>
<BlurView
blurType="regular"
style={{
position: 'absolute',
top: 100,
left: 20,
right: 20,
height: 200,
borderRadius: 20,
}}
>
<Text style={{ textAlign: 'center', marginTop: 50 }}>
Content on blur background
</Text>
</BlurView>
</View>
);
}
import React from 'react';
import { BlurView, BlurType } from 'blur-react-native';
const blurTypes: BlurType[] = [
'light',
'dark',
'regular',
'systemMaterial',
'systemThickMaterial',
];
export function BlurDemo() {
return (
<View>
{blurTypes.map((type) => (
<BlurView
key={type}
blurType={type}
blurAmount={80}
reducedTransparencyFallbackColor="#FFFFFF"
style={{
height: 100,
margin: 10,
borderRadius: 15,
}}
>
<Text>{type} blur effect</Text>
</BlurView>
))}
</View>
);
}
Prop | Type | Default | Description |
---|---|---|---|
blurType | BlurType | 'regular' | The type of blur effect to apply |
blurAmount | number | 100 | Blur intensity from 0-100 |
reducedTransparencyFallbackColor | string | '#FFFFFF' | Fallback color when reduced transparency is enabled |
style | ViewStyle | undefined | Style object for the blur view |
children | ReactNode | undefined | Child components to render on top of blur |
The following blur types are available on both platforms:
'light'
- Light blur effect with white tint'extraLight'
- Extra light blur effect with minimal tint'dark'
- Dark blur effect with black tint'regular'
- Standard blur effect with neutral tint'prominent'
- Enhanced blur effect with stronger material appearance'systemUltraThinMaterial'
- Ultra-thin system material'systemThinMaterial'
- Thin system material'systemMaterial'
- Standard system material'systemThickMaterial'
- Thick system material'systemChromeMaterial'
- Chrome system material<BlurView blurType="systemMaterial" style={StyleSheet.absoluteFill}>
<View style={styles.modalContent}>
<Text>Modal Content</Text>
</View>
</BlurView>
<BlurView
blurType="systemThickMaterial"
blurAmount={90}
style={{
padding: 20,
borderRadius: 16,
margin: 16,
}}
>
<Text style={styles.cardTitle}>Card Title</Text>
<Text style={styles.cardContent}>Content here</Text>
</BlurView>
<BlurView
blurType="systemChromeMaterial"
style={{
position: 'absolute',
top: 0,
left: 0,
right: 0,
height: 100,
paddingTop: 50,
}}
>
<Text style={styles.navTitle}>Navigation Title</Text>
</BlurView>
The library automatically respects the system's "Reduce Transparency" accessibility setting:
UIAccessibilityIsReduceTransparencyEnabled()
reducedTransparencyFallbackColor
to set your preferred fallbackiOS:
UIVisualEffectView
for optimal performance and battery lifeAndroid:
android.graphics.RenderEffect
for hardware-accelerated blurRenderScript
with ScriptIntrinsicBlur
for GPU accelerationHandlerThread
for smooth UIPod install fails:
cd ios && rm -rf Pods Podfile.lock && pod install --repo-update
Build errors:
Build failures:
compileSdkVersion
is 31 or higher for modern blur effectsminSdkVersion
is 17 or higherPerformance issues:
blurAmount
for better performanceSee the contributing guide to learn how to contribute to the repository and the development workflow.
Disclaimer: Most of this README and code was written by vibe coding™ 🎵✨ - if you find a bug, please raise a PR! We promise it's more fun than debugging alone 😄
MIT
Made with create-react-native-library
FAQs
Jellify Blur
The npm package blur-react-native receives a total of 117 weekly downloads. As such, blur-react-native popularity was classified as not popular.
We found that blur-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.