managarten/memoro/apps/mobile/features/menus/ReadMes/react-native-action-sheet.md
Till-JS e7f5f942f3 chore: initial commit - consolidate 4 projects into monorepo
Projects included:
- maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing)
- manacore (Expo mobile + SvelteKit web + Astro landing)
- manadeck (NestJS backend + Expo mobile + SvelteKit web)
- memoro (Expo mobile + SvelteKit web + Astro landing)

This commit preserves the current state before monorepo restructuring.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:38:24 +01:00

6.8 KiB

react-native-action-sheet

@expo/react-native-action-sheet npm License: MIT Discord

React Native Action Sheet is a cross-platform React Native component that uses the native UIActionSheet on iOS and a pure JS implementation on Android.

iOS Android Web

Check out the example snack here! Installation npm install @expo/react-native-action-sheet or

yarn add @expo/react-native-action-sheet A basic ActionSheet Setup

  1. Wrap your top-level component with ReactNativeActionSheet uses React context to allow your components to invoke the menu. This means your app needs to be wrapped with the ActionSheetProvider component first.

import { ActionSheetProvider } from '@expo/react-native-action-sheet';

export default function AppContainer() { return ( ); } 2. Call the showActionSheetWithOptions method with a hook or a higher order component. // Using the provided hook import { useActionSheet } from '@expo/react-native-action-sheet';

export default Menu() { const { showActionSheetWithOptions } = useActionSheet();

const onPress = () => { const options = ['Delete', 'Save', 'Cancel']; const destructiveButtonIndex = 0; const cancelButtonIndex = 2;

showActionSheetWithOptions({
  options,
  cancelButtonIndex,
  destructiveButtonIndex
}, (selectedIndex: number) => {
  switch (selectedIndex) {
    case 1:
      // Save
      break;

    case destructiveButtonIndex:
      // Delete
      break;

    case cancelButtonIndex:
      // Canceled
  }});

}

return (