showing results for - "capacitor popup"
David
12 Nov 2017
1import { Plugins, ActionSheetOptionStyle } from '@capacitor/core';
2
3const { Modals } = Plugins;
4
5async showAlert() {
6  let alertRet = await Modals.alert({
7    title: 'Stop',
8    message: 'this is an error'
9  });
10}
11
12async showConfirm() {
13  let confirmRet = await Modals.confirm({
14    title: 'Confirm',
15    message: 'Are you sure you\'d like to press the red button?'
16  });
17  console.log('Confirm ret', confirmRet);
18}
19
20async showPrompt() {
21  let promptRet = await Modals.prompt({
22    title: 'Hello',
23    message: 'What\'s your name?'
24  });
25  console.log('Prompt ret', promptRet);
26}
27
28async showActions() {
29  let promptRet = await Modals.showActions({
30    title: 'Photo Options',
31    message: 'Select an option to perform',
32    options: [
33      {
34        title: 'Upload'
35      },
36      {
37        title: 'Share'
38      },
39      {
40        title: 'Remove',
41        style: ActionSheetOptionStyle.Destructive
42      }
43    ]
44  })
45  console.log('You selected', promptRet);
46}
similar questions
queries leading to this page
capacitor popup