Cross-platform native header blur for Expo apps:
- iOS: true variable blur powered by
UIVisualEffectView+variableBlurfilter - Android: progressive blur/tint header powered by Haze
Designed for frosted headers where blur intensity fades from top to bottom.
- Native
VariableHeaderBlurViewfor iOS + Android - Progressive top-to-bottom blur gradient
- Configurable tint gradient (
tintOpacityTop,tintOpacityMiddle) - Adjustable blur strength (
maxBlurRadius) - Configurable header region (
headerHeight) - Android-only advanced tuning (
tintColor,progressiveStartY,progressiveEndY)
variable-header-github.mp4
header-blur-github-android.mp4
Based on nikstar/VariableBlur:
UIVisualEffectViewwith obfuscated privatevariableBlurfilter- Gradient mask drives blur intensity per pixel
- SwiftUI wrapper layered inside an Expo
ExpoView
Android uses the Haze pipeline inside a Compose-backed native view:
hazeSource(state)marks the content source layerhazeEffect(state)applies blur + tintHazeProgressive.verticalGradient(...)controls progressive blur falloff- Additional Canvas gradient aligns tint transition with blur ramp
This gives a close visual analogue to iOS progressive headers on Android.
This module contains custom native code, so it does not work in Expo Go.
npx expo prebuild
npx expo run:ios
npx expo run:androidmodules/variable-header-blur
Add to app package.json:
{
"dependencies": {
"variable-header-blur": "file:./modules/variable-header-blur"
}
}Then install:
yarn installnpx expo prebuild
npx expo run:android
npx expor run:iosimport { VariableHeaderBlurView } from "variable-header-blur";
<VariableHeaderBlurView
headerHeight={HEADER_TOTAL_HEIGHT}
maxBlurRadius={16}
tintOpacityTop={0.3}
tintOpacityMiddle={0.1}
style={{ position: "absolute", top: 0, left: 0, right: 0 }}
>
{/* Header content */}
</VariableHeaderBlurView>;| Prop | Type | Description |
|---|---|---|
headerHeight |
number |
Height of the blur header region. |
maxBlurRadius |
number |
Maximum blur intensity (15 iOS / 16 Android by default). |
tintOpacityTop |
number |
Top tint opacity (0.4 iOS / 0.3 Android defaults). |
tintOpacityMiddle |
number |
Mid tint opacity (0.1 default). |
tintColor |
string |
Tint color (Android only currently). |
progressiveStartY |
number |
Progressive blur start Y position (Android only). |
progressiveEndY |
number |
Progressive blur end Y position (Android only). |
style |
ViewStyle |
Standard React Native style prop. |
children |
ReactNode |
Content placed inside the header blur container. |
src/VariableHeaderBlurView.tsxexposes the native view manager.ios/VariableHeaderBlurView.swifthosts variable blur + tint gradient.android/VariableHeaderBlurView.kthosts Haze progressive blur + tint gradient.- Native props are mapped via
VariableHeaderBlurModuleon both platforms.
- iOS variable blur inspiration: nikstar/VariableBlur
- Android blur pipeline: chrisbanes/haze