alert react native

Solutions on MaxInterview for alert react native by the best coders in the world

showing results for - "alert react native"
Beatrice
05 Mar 2017
1import React, { useState } from "react";
2import { View, StyleSheet, Button, Alert } from "react-native";
3
4const App = () => {
5  const createTwoButtonAlert = () =>
6    Alert.alert(
7      "Alert Title",
8      "My Alert Msg",
9      [
10        {
11          text: "Cancel",
12          onPress: () => console.log("Cancel Pressed"),
13          style: "cancel"
14        },
15        { text: "OK", onPress: () => console.log("OK Pressed") }
16      ]
17    );
18
19  const createThreeButtonAlert = () =>
20    Alert.alert(
21      "Alert Title",
22      "My Alert Msg",
23      [
24        {
25          text: "Ask me later",
26          onPress: () => console.log("Ask me later pressed")
27        },
28        {
29          text: "Cancel",
30          onPress: () => console.log("Cancel Pressed"),
31          style: "cancel"
32        },
33        { text: "OK", onPress: () => console.log("OK Pressed") }
34      ]
35    );
36
37  return (
38    <View style={styles.container}>
39      <Button title={"2-Button Alert"} onPress={createTwoButtonAlert} />
40      <Button title={"3-Button Alert"} onPress={createThreeButtonAlert} />
41    </View>
42  );
43}
44
45const styles = StyleSheet.create({
46  container: {
47    flex: 1,
48    justifyContent: "space-around",
49    alignItems: "center"
50  }
51});
52
53export default App;
David
18 Oct 2020
1// Works on both Android and iOS
2Alert.alert(
3  'Alert Title',
4  'My Alert Msg',
5  [
6    {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
7    {
8      text: 'Cancel',
9      onPress: () => console.log('Cancel Pressed'),
10      style: 'cancel',
11    },
12    {text: 'OK', onPress: () => console.log('OK Pressed')},
13  ],
14  {cancelable: false},
15);
16
Victoria
29 Mar 2016
1//I was going through the same thing and I found a way to style it. in styles.xml add:
2
3//In AppTheme add:
4
5<item name="android:alertDialogTheme">@style/AlertDialogTheme</item>
6//Then:
7
8<style name="AlertDialogTheme" parent="Theme.AppCompat.Dialog.Alert">
9    <item name="android:background">#00397F</item>
10    <item name="android:colorPrimary">#00397F</item>
11    <item name="android:colorAccent">#0AAEEF</item>
12    <item name="android:buttonBarNegativeButtonStyle">@style/NegativeButtonStyle</item>
13    <item name="android:buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
14</style>
15
16<style name="NegativeButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
17    <item name="android:textColor">#F0A90F</item>
18</style>
19
20<style name="PositiveButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
21    <item name="android:textColor">#F0A90F</item>
22</style>
23//Play with it and add more customized values as needed.
queries leading to this page
react native how to make a alert boxestilizar alert react nativealert alternative in react nativehow to style alert in react nativeimport alert react nativereact native alert nativereact native alert messagereact native alert stylealert in native basreact native alert with buttonsalerts react nativereact natvie alertalert react native buttonsnative react alertsimple alert in react nativealert input react nativereact native alert with inputhow to make a alert with input box in react nativereact native alert backdrop clickuse alert component in react nativereact native alert ok actionalert for react native appreact ios style alerthow to display a message in react nativehow to customize alert in react nativealert alert react nativereact native alert gets displayed on next screenreact native alert with 5 buttons androidreact native input alertreact native alertviewreact native change text in alerthow to alert in react nateiveract native alertalert react native sample appreact native error alertreact native show alertstyle alert react nativecustomize alert color react nativealert syle react nativereact native information alertbig alert style reactreact native laertreact native element alertsreact native android style alert text alignalert in react natviehow to set duration on alert react nativecreate alert react nativeshow buttons inside alert react nativecomponent on alert react nativealert alert react nativreact native web alertalert alert theme react nativealert with button react nativealert background react nativealert options react nativereact native alert with custom viewreact natvie alertsexemple de alert dans react nativereact native style alert dialog boxconfirm modal react nativereact native android alert text alignreact native alert alertalert with input react nativereact native alert in webreact native desinged alert with msgalert as a info react nativealertios react nativereact native alert custom viewalert react native simplealert on press react nativealert design in react nativeuse alert in react nativealertin react nativereact native alert stylingstyle react native alert texthow to alert in react nativeshow alert in react nativedesigning alert in react nativereact native alert without buttonalert react native one button messagechange button style alert react nativereact native alert button actioncustomiz alert in react native react native alert 4 buttonsreact ative alerthow to update alert button is pressed in react nativecustomize alert react nativeshow dialog in prefernce androidreact native raise alertalert alert react not nativereact native alert 28 29how to do alert react nativealert alertdetails tag alert on react nativealert alert react native size of messagealert alert react native sizehow to implement custom alert in button click in react nativealert react native webbutton in jsalert with input react nativenative base alertreact native alert text alignalert with state react nativealert button nativereact native text on alertreact native alert box with inputreact native alert text colorhow to do react native alertalert alert react native stylenreact native alertcatch ok alert alert react nativereact native alert alertreact native button alertrect native alertreact native custom alert react native alert componentchnage react antive alert stylealert function in react nativereact native alertsalert from react nativereact native alert bold textreact native alert examplereact alert text colorstyle alerts in react nativereact native alertinput alert react nativereact native alert stylealert react native 5cis there a way to read text alert test react nativereacct native alertalert box in react nativealert ok button styles react nativereact antive alertalert alert view react nativereact native alert alignhow to return alert function in react nativereact native alert button styleonpress alert in react nativefont in react native alert alert component react nativealert with one button react nativealert dialog in react nativehow ot handle onclick push notificaiton in react native push notification when app is closedreact native create alertalerts in react native androidhow to call this function in alert in react nativereact native alert androidalert ract nativealert button react nativereact native style alertalert in react nativeuse ios custom alert react nativehow to style alert in react nativereact native alert buttons examplealerts on react nativehow to show alert message in react nativereact native 7balert alert 28using alert box in react nativealert in react antivealert view in react nativehow to give an alert in react nativereact native alethow to use alert as component in reactnativereact native alertreact native stylingn alertsalert ios react nativealert in react native inside a functioncreate progress bar in reactshow text on hover in semantic ui reactprevent menu icon replace back button react nativereact native elements alertdisplay alert react nativealert react native change text formatshow alert react nativealerts in react nativereact native alertereact native alert text align leftalert react nativereact native alert buttonsreact native do something when alert close is pressedsemantic ui react close modal on button clickhow to put button inside alert react nativecustom alert in reactreact native alert alert stylenative react alertreact native alert iconreact native alert boxhow to set alert in react native app from android devicereact native props alertreact native alert functionreact native alert with buttonreact native alert 3 buttonsreact native alert dialog colorshow alert on button click react nativealert alert function in react nativehow to add button in alert box in react nativereact fade in apireact native show alert messagereact native alert to confirm react native confirmation alertreat native alertcustomize alert box react nativealert react nativalert nativereactnative alerthow to customize alert box in react nativereactnative alertsalert for react nativereact natiive alert alert message when button is clicked react nativereact native onpress alertalerts library react nativealert tag in react nativealert alert react native add buttonreact native elements alertset style for button in react native alertreact native alert with imageremove alert box title react nativehow to use alert in react nativealert button in react nativereact native alert namereact native alert with custom designalert component in react nativereact naitve alertshow alert on click react nativebackground alert react nativealert alert in react nativereact native alertaleartreact native alert with inputwindow alert react nativereact native android style alertbutton alert react nativealert react native red buttonimport alert react nativealert alert component react nativecan you give icon to react native alertalert message in react native on clicking of buttonalert on react nativehow to transform text inside alert of react nativealert in react nativealert type input react nativereact style alert boxcreating an alert in react nativereact native alert style destructivechange back button icon react navigationalert message react nativechange apperance of alret react nativealert react native examplereact native alert dialog how to put input in alert jsalert message in react nativealert box react nativehow to style react native alert buttonsusing alert in react nativereact native alert optionsreact native alert single buttonreact native alert buttoncancelable 3a false react native alertreact natve alertreact native alertreact native alert with buttonsreact native alert laerthow to change styling on alert in react nativereact native alert set componenthow to render alert in view reactnativecreate alert react native elementshtml native alert with buttonscustomize alert in react nativereact native alertreact native alert alertbuttonreact native alert alert stylecustomised alert reactreact style alertreact native alert custom stylealert react native stylealert react nativereact native alert center textreact native alert change fontcustom alert react nativeadd color to alert option react nativereact native alert choicesreact native alert with imagestyling alert box in reactalert react native