Main goal of this library is that support prompt for android and looks more beautiful on android.
"react-native-alert": "sergeymild/react-native-alert#0.6.3
$ yarn
import {Alert} from 'react-native-alert';
export type AlertType = 'default' | 'plain-text' | 'secure-text';
type DefaultButton = { text: string; onPress?: () => void; style: 'default' };
type InputButton = {
text: string;
onPress?: (value: string) => void;
style: 'default';
};
type CancelButton = { text: string; onPress?: () => void; style: 'cancel' };
type DestructiveButton = {
text: string;
onPress?: () => void;
style: 'destructive';
};
type AlertParams = {
title: string;
message?: string;
buttons?: Array<CancelButton | DefaultButton | DestructiveButton>;
theme?: 'dark' | 'light' | 'system';
};
type PromptParams = {
title: string;
message?: string;
buttons?: Array<InputButton | CancelButton>;
type?: AlertType;
theme?: 'dark' | 'light' | 'system';
defaultValue?: string;
keyboardType?: KeyboardType;
};
Alert.alert(AlertParams);
Alert.prompt(PromptParams);