Skip to content

React Native Alert module which matchs pilipa UI style in native code

License

Notifications You must be signed in to change notification settings

pilipa-cn/react-native-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-alert

React Native Alert module which matchs pilipa UI style in native code The api is same as React Native offical Alert API.

Usage:

npm install --save pilipa-cn/react-native-alert
import Alert from "react-native-alert";
Alert.alert('标题', '确定退出');

Change made to iOS version:

by default, all buttons text color is #EF0C35.

To made a cancel button:

Alert.alert('标题', '确定退出\n退出后将重新登录', [
    {
        text: "取消",
        onPress: ()=>{
            console.log('you clicked cancel');
        },
        style: 'cancel'
    }
    ]);

To override default color, just specify your own color:

Alert.alert('标题', '确定退出\n退出后将重新登录', [
    {
        text: "取消",
        onPress: ()=>{
            console.log('you clicked cancel');
        },
        color: "#009696",
        style: 'cancel'
    }]);

Android

The first button is always cancel and second one always means ok, so far the button color can't be changed.

By default the alert can't be cancel, means can't press empty area to dismiss the alert dialog.

Alert.alert('', '',[ ... ], {cancelable: true});

TODO

Android support override default button color.

About

React Native Alert module which matchs pilipa UI style in native code

Resources

License

Stars

Watchers

Forks

Packages

No packages published