0.0.24 • Published 3 years ago
react-native-surfinn-alert v0.0.24
React Native Surfinn Alert
This is a custom component of React Native, a fully customized pop-up compatible with iOS and Android.
It just provides a pop-up container with a background, so you can implement your own view.
Install
Install reanimated v2 first. see https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/
npm
npm install react-native-surfinn-alert
yarn
yarn add react-native-surfinn-alert
Usage
Add AlertProvider to top of your app
import {AlertProvider} from 'react-native-surfinn-alert';
<AlertProvider>
...
</AlertProvider>;
and add Alert to your screen or component
import {Alert} from 'react-native-surfinn-alert';
const alertRef = React.useRef(null);
const open = () => {
alertRef.current?.open();
};
const close = () => {
alertRef.current?.close();
};
return (
<View>
<Button onPress={open} title="Open Alert" />
<Alert ref={alertRef} backdrop backdropOpacity={0.3}>
<View style={styles.alert}>
<Text>Alert Title</Text>
<Text>Alert Messages</Text>
<Button onPress={close} title="Close Alert" />
</View>
</Alert>
</View>
);
const styles = StyleSheet.create({
alert: {
backgroundColor: 'white',
padding: 20,
borderRadius: 10,
}
})
See more https://github.com/hjyong/react-native-surfinn-alert.git
0.0.24
3 years ago
0.0.23
3 years ago
0.0.22
3 years ago
0.0.21
3 years ago
0.0.20
3 years ago
0.0.19
3 years ago
0.0.18
3 years ago
0.0.17
3 years ago
0.0.16
3 years ago
0.0.15
3 years ago
0.0.14
3 years ago
0.0.13
3 years ago
0.0.12
3 years ago
0.0.11
3 years ago
0.0.10
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago