1.0.0 • Published 5 years ago

@qiqi715/react-native-alert v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

React Native Alert

Demo

alt text alt text

Getting Started

Installation

$ npm i @qiqi715/react-native-alert --save

Basic Usage

RNAlert.alert(
  'Alert Title',
  'My Alert Msg',
  [
    {
      text: 'Ask me later',
      onPress: () => console.log('Ask me later pressed'),
    },

    {
      text: 'Cancel',
      onPress: () => console.log('Cancel Pressed'),
    },
    {
      text: 'OK',
      onPress: () => console.log('OK Pressed'),
    },
  ],
);

Methods

alert()

static alert(title: string, [message]: string, buttonsArray)
PropTypeDescriptionDefault
titlestringTitle text to display-
messagestringMessage text to display-
buttonsArrayarrayan array of buttons, each button should include a text key, as well as optional onPress and style keys[]

buttonsArray's each button

PropTypeDescriptionDefault
textstringtext of button-
onPressfuncAction to perform when button is pressed-
styleobjectbutton style-

MIT Licensed

Released under the Mit License