ActionSheetIOS API displays native iOS action sheets and share sheets. Action sheets present a set of options to the user, while share sheets enable content sharing through iOS’s native sharing capabilities.
Import
Methods
showActionSheetWithOptions()
options: Configuration object (see Options below)callback: Function called with the zero-based index of the selected button
Options
Example
showShareActionSheetWithOptions()
options: Share configuration object (see Options below)failureCallback: Called if sharing failssuccessCallback: Called with success status and sharing method
Options
If
url points to a local file or is a base64-encoded URI, the file will be loaded and shared directly. This allows sharing images, videos, PDFs, etc.Example
dismissActionSheet()
Example
Usage Examples
Basic Action Sheet
Action Sheet with Styling
Share Sheet
Sharing Local Image
Multiple Destructive Buttons
Platform-Specific Action Sheet
Notes
- ActionSheetIOS only works on iOS. On other platforms, calls are ignored.
- On iPad, action sheets are displayed as popovers. Use the
anchorprop to specify the anchor point. - Destructive buttons are displayed in red to indicate destructive actions.
- The cancel button is always displayed at the bottom (on iPhone) or outside the popover (on iPad).
- Disabled buttons appear grayed out and don’t trigger the callback when tapped.
- For sharing files, use
file://URLs or base64-encoded data URIs. - The share sheet respects the user’s sharing preferences and app availability.