React Native Animated Blur component
https://www.npmjs.com/package/react-native-animated-blur-view
npm install react-native-animated-blur-view
import AnimatedBlurView, { AnimatedBlurViewMethods } from "react-native-animated-blur-view";
export default function App() {
const blurViewRef = useRef<AnimatedBlurViewMethods>();
useEffect(() => {
blurViewRef.current?.start(true);
}, []);
return (
<View style={styles.container}>
<Text>React Native Animated Blur View</Text>
<AnimatedBlurView
ref={blurViewRef}
style={StyleSheet.absoluteFillObject}
blurStart={10}
blurEnd={20}
animationDuration={2}
/>
</View>
);
}
Props:
blurStart
: number (required). Blur effect start amount.blurEnd
: number (required). Blur effect end amount.animationDuration
: number (required). Animation duration in seconds.gradient
: boolean (optional). Add gradient effect. Default is false.style
: StyleProp (optional). View style of the component.animationType
: string (optional). Blur Animation type. One ofease
,linear
,ease-in
,ease-out
,ease-in-out
,cubic-bezier(n,n,n,n)
. Default isease
.extraStyles
: string (optional). Add extra css styles to blur component.
ref.current?.start(true, () => console.log('Finished'));
Animates blur view from blurStart amount to blurEnd amount in given animation duration.
ref.current?.reset(true);
Will stop animation and set blurStart/blurEnd amount.
ref.current?.setBlurAmount(10);
Will set given blur amount without animation.
![devmenu](https://private-user-images.githubusercontent.com/13519034/276951013-4f60f146-7c06-4cad-b049-6e55be72609d.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxOTM2ODMsIm5iZiI6MTczOTE5MzM4MywicGF0aCI6Ii8xMzUxOTAzNC8yNzY5NTEwMTMtNGY2MGYxNDYtN2MwNi00Y2FkLWIwNDktNmU1NWJlNzI2MDlkLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDEzMTYyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEzOWIyZTczOGZjNzI2MzA5NTU4YWM1OWM3YjE4NzJjNDkxYjRkMmVkOTI1ZDU2ZmY1NGQ5ZDJkMDVlYjk5MWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8i21ysxQUT2HWW1uBj1-cKOcZ7BsKr1lPFbgoIPNsVA)
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT