expo-ios-visual-blur
v0.1.0
Published
π¨ Native iOS progressive blur for React Native (Expo) β smooth, customizable SwiftUI blur effects with directional gradients and easy integration. πβ¨
Downloads
483
Maintainers
Readme
β¨ Features
- π Native SwiftUI implementation for performant and smooth blur effects on iOS
- π Progressive variable blur with customizable max blur radius
- π Directional blur gradients: blurred top to clear bottom or blurred bottom to clear top
- π¨ Supports start offset control for where blur begins vertically
- βοΈ Dynamic, runtime-updatable blur parameters with seamless transitions
- πΌοΈ Can overlay on any React Native view with children support
- π« Safe area aware, or choose to ignore it for fullscreen effects
- π Optional masking and flexible styling via React Native props
- π± Exclusive iOS support using native UIVisualEffectView + CAFilter for advanced blur control
π Installation
1. Add the package
npx expo install expo-ios-visual-blur2. Install CocoaPods dependencies
cd ios && pod install3. (Optional) Prebuild the iOS project if you use bare workflow or custom native code
npx expo prebuild --platform ios4. Run your app
pnpm ios
# or
npx expo run:iosβ οΈ Note: This module uses SwiftUI and iOS-only native APIs β it does not support Android or other platforms.
π¦ Usage
import React from "react";
import { BlurView, BlurViewDirection } from "expo-ios-visual-blur";
import { Image } from "react-native";
export default function App() {
return (
<BlurView
direction={BlurViewDirection.BlurredBottomClearTop}
maxBlurRadius={21}
startOffset={0.1}
style={{ borderRadius: 10, overflow: "hidden" }}
>
<Image
source={{
uri: "https://images.unsplash.com/photo-1754638069174-7aa06c176b61?q=80&w=1364&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
}}
style={{ width: 200, height: 200 }}
/>
</BlurView>
);
}βοΈ Props
| Prop | Type | Default | Description |
| --------------- | ------------------- | ------------------------- | -------------------------------------------------------------------- |
| maxBlurRadius | number | 20 | Maximum blur radius applied to the view |
| direction | BlurViewDirection | "blurredTopClearBottom" | Direction of the blur gradient β from top to bottom or bottom to top |
| startOffset | number (0 to 1) | 0 | Starting point of the blur gradient (relative vertical offset) |
| style | ViewStyle | undefined | Custom styles applied to the container view |
| children | React.ReactNode | undefined | React Native children to render inside the blur |
π€ BlurViewDirection Enum
| Direction | Description |
| ----------------------- | ----------------------------- |
| BlurredTopClearBottom | Blur fades from top to bottom |
| BlurredBottomClearTop | Blur fades from bottom to top |
π± Platform Support
| Platform | Support | | -------- | ---------------------------- | | iOS | β Fully supported (SwiftUI) | | Android | β Not supported | | Web | β Not supported |
π Built With
- βοΈ React Native & Expo
- π SwiftUI
- π§ͺ Native iOS
UIVisualEffectViewwith customCAFilterfor variable blur
β€οΈ Contributing
Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue.
π License
MIT Β© rit3zh
