@capacitor/action-sheet
The Action Sheet API provides access to native Action Sheets, which come up from the bottom of the screen and display actions a user can take.
Install
npm install @capacitor/action-sheet@latest-6
npx cap sync
Variables
This plugin will use the following project variables (defined in your app's variables.gradle file):
androidxMaterialVersion: version ofcom.google.android.material:material(default:1.10.0)
PWA Notes
PWA Elements are required for Action Sheet plugin to work.
Example
import { ActionSheet, ActionSheetButtonStyle } from '@capacitor/action-sheet';
const showActions = async () => {
const result = await ActionSheet.showActions({
title: 'Photo Options',
message: 'Select an option to perform',
options: [
{
title: 'Upload',
},
{
title: 'Share',
},
{
title: 'Remove',
style: ActionSheetButtonStyle.Destructive,
},
],
});
console.log('Action Sheet result:', result);
};