Gathering detailed insights and metrics for cordova-plugin-actionsheet
Gathering detailed insights and metrics for cordova-plugin-actionsheet
Gathering detailed insights and metrics for cordova-plugin-actionsheet
Gathering detailed insights and metrics for cordova-plugin-actionsheet
npm install cordova-plugin-actionsheet
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
208 Stars
81 Commits
72 Forks
14 Watching
1 Branches
6 Contributors
Updated on 31 Jan 2024
JavaScript (34.03%)
Objective-C (24.92%)
C# (22.77%)
Java (18.28%)
Cumulative downloads
Total Downloads
Last day
3.1%
2,273
Compared to previous day
Last week
-7%
11,692
Compared to previous week
Last month
4.4%
52,128
Compared to previous month
Last year
9.9%
583,894
Compared to previous year
No dependencies detected.
Show a sheet of options the user can choose from.
UIActionSheet
AlertDialog
Popup
iOS
Android
Windows Phone 8
$ cordova plugin add cordova-plugin-actionsheet
$ cordova prepare
ActionSheet.js is brought in automatically. There is no need to change or add anything in your html.
ActionSheet works with PhoneGap build too! Just add the following xml to your config.xml
to always use the latest version of this plugin:
1<plugin name="cordova-plugin-actionsheet" />
ActionSheet.js is brought in automatically. Make sure though you include a reference to cordova.js in your index.html's head:
1<script type="text/javascript" src="cordova.js"></script>
Check the demo code to get you going quickly, or copy-paste some of the code below to replicate the ActionSheets of the screenshots above.
Also, wait for deviceready
to fire before using plugins in general!
1 var callback = function(buttonIndex) { 2 setTimeout(function() { 3 // like other Cordova plugins (prompt, confirm) the buttonIndex is 1-based (first button is index 1) 4 alert('button index clicked: ' + buttonIndex); 5 }); 6 }; 7 8 function testShareSheet() { 9 var options = { 10 androidTheme: window.plugins.actionsheet.ANDROID_THEMES.THEME_DEVICE_DEFAULT_LIGHT, // default is THEME_TRADITIONAL 11 title: 'What do you want with this image?', 12 subtitle: 'Choose wisely, my friend', // supported on iOS only 13 buttonLabels: ['Share via Facebook', 'Share via Twitter'], 14 androidEnableCancelButton : true, // default false 15 winphoneEnableCancelButton : true, // default false 16 addCancelButtonWithLabel: 'Cancel', 17 addDestructiveButtonWithLabel : 'Delete it', 18 position: [20, 40], // for iPad pass in the [x, y] position of the popover 19 destructiveButtonLast: true // you can choose where the destructive button is shown 20 }; 21 // Depending on the buttonIndex, you can now call shareViaFacebook or shareViaTwitter 22 // of the SocialSharing plugin (https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin) 23 window.plugins.actionsheet.show(options, callback); 24 }; 25 26 function testDeleteSheet() { 27 var options = { 28 'addCancelButtonWithLabel': 'Cancel', 29 'addDestructiveButtonWithLabel' : 'Delete note' 30 }; 31 window.plugins.actionsheet.show(options, callback); 32 }; 33 34 function testLogoutSheet() { 35 var options = { 36 'buttonLabels': ['Log out'], 37 'androidEnableCancelButton' : true, // default false 38 'winphoneEnableCancelButton' : true, // default false 39 'addCancelButtonWithLabel': 'Cancel' 40 }; 41 window.plugins.actionsheet.show(options, callback); 42 };
On iOS, you can also position the actionSheet origin by adding position: [100, 200]
If for some reason you want to hide the actionsheet programmatically, do this:
1 // options and callbacks are optional, so either approach will work: 2 window.plugins.actionsheet.hide(); 3 window.plugins.actionsheet.hide({}, onSuccess, onError);
iOS and WP8 code: Eddy Verbruggen
Android code: mostly Brill Papping
subtitle
(iOS) and destructiveButtonLast
preferences. Also, iOS now uses the newer UIAlertController
instead of UIActionSheet
.<meta charset="utf-8" />
to your html file.Español
as a title or button label.actionSheet.showFromRect
method)Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 5/18 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More