Displays Android's native AlertDialog
npm install react-native-alert-dialog-android
import { MessageDialog } from 'react-native-alarm-dialog';
// ...
<Button
onPress={() =>
MessageDialog({
menuTitle: 'Title',
message: 'Hello World',
negative: { title: 'Cancel', onPress: () => console.log('Cancel') },
positive: { title: 'OK', onPress: () => console.log('OK') },
neutral: {
title: 'Neutral',
onPress: () => console.log('Neutral'),
},
})
}
title={'Message Menu'}
/>
import { ButtonDialog } from 'react-native-alarm-dialog';
// ...
<Button
onPress={() => {
ButtonDialog({
menuTitle: 'Title',
buttons: [
{ title: 'Button 1', onPress: () => console.log('Button 1') },
{ title: 'Button 2', onPress: () => console.log('Button 2') },
{ title: 'Button 3', onPress: () => console.log('Button 3') },
],
negative: { title: 'Cancel', onPress: () => console.log('Cancel') },
positive: { title: 'OK', onPress: () => console.log('OK') },
neutral: {
title: 'Netural',
onPress: () => console.log('Netural'),
},
});
}}
title="Button Menu"
/>
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT