🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

react-native-scale-alert

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

react-native-scale-alert

A react native alert component

unpublished
latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

React Native Scale Alert

Demo

react-native-scale-alert

Getting Started

  • Installation
  • Basic Usage
  • Props

Installation

$ npm i react-native-scale-alert --save

Basic Usage

import React from 'react';
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';

import Alert from 'react-native-scale-alert';

export default class App extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
		visible:false
	};
  };

	showAlert = (status) => {
        this.setState({
            visible: status
        })
    }
	
  render() {
    const {visible} = this.state;

    return (
       <View style={styles.container}>
                <TouchableOpacity 
					onPress={() => this.showAlert('success')}
					style={styles.buttonStyle}
				>
                    <Text style={styles.textStyle}>
                        CLICK ME
                    </Text>
                </TouchableOpacity>
                <Alert
                    overlay={true}
					overlayColor='rgba(0,0,0,0.1)'
                    visible={visible}
                    status={visible}
                    title='SUCCESS'
                    message='Lorem ipsum dolor sit amet.'
                    showButton={true}
                />
            </View>
    );
  };
};

const styles = StyleSheet.create({
container: {
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center'
    },
    textStyle: {
        fontSize: 24
    }
});

Props

Basic

PropTypeDescriptionDefault
visiblebooleanShow / Hide alertfalse
titlestringTitle text to displayhidden
messagestringMessage text to displayhidden
showButtonboolShow a confirmation buttonfalse
buttonTextboolConfirmation button textfalse
overlayboolShow a overlayfalse
statusstringIndicates the status of the alertfalse
propIconobjectIcon customizationfalse
onConfirmPressedfuncAction to perform when Confirm is pressed-

Styling

PropTypeDescriptionDefault
containerStyleobjectAlert popup style-
overlayColorstringOverlay color change-
titleStyleobjectTitle style-
messageStyleobjectMessage style-
confirmButtonStyleobjectConfirm button style-
confirmButtonTextStyleobjectConfirm button text style-
circleColorstringCircle color style-

Contribution

Questions

Feel free to Contact me or Create an issue

License

Released under the Mit License

Keywords

react-native-alert

FAQs

Package last updated on 19 Nov 2019

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