Socket
Book a DemoInstallSign in
Socket

react-native-surfinn-alert

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-surfinn-alert

React Native Surfinn Alert

0.0.24
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

react-native

FAQs

Package last updated on 27 Dec 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.