Context Menu For Expo
npm install @appandflow/expo-context-menuCrossplatform Context Menu component - compatible with Expo managed apps.
https://developer.apple.com/design/human-interface-guidelines/context-menus
With our library you can customize your context menu to have the look and feel of the native menus. You can see the full repository of this example here.
``sh`
npm install @appandflow/expo-context-menu
Wrap your application with the ExpoContextMenuProvider
`tsx
import { ExpoContextMenuProvider } from '@appanflow/expo-context-menu';
`
Then you can use the lib with the ExpoContextMenu component
`tsx
import { ExpoContextMenu } from '@appandflow/expo-context-menu';
menuItems={[
{
title: 'Add to Favorites',
onPress: () => null,
icon:
},
{
title: 'Share',
onPress: () => null,
icon:
},
]}
>
`
| Name | Description |
| ---- | ----------- |
| menuItems | Custom items you can display when the context menu is open |
`tsx``
{
title: string;
icon?: React.ReactElement;
onPress: () => void;
destructive?: boolean;
}[];
| Name | Description |
| ---- | ----------- |
| renderMenu (optional) | Custom component to replace the container rendering the menuItems |
| isFullScreen (optional) | Boolean to have the full screen layout animation |
| onPress (optional) | Function to pass a custom event when pressing on the children |
| onLongPressStart (optional) | Callback to customize the long press starting action |
| onLongPressEnd (optional) | Callback to customize the long press ending action |
| onMenuOpen (optional) | Callback to customize the children when the menu is open |
| onMenuClose (optional) | Callback to customize the children when the menu closes |
| itemScaleOnMenuOpen (optional) | Number to change the scale of the children when the menu is open (default to 0.97) |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
---
Made with create-react-native-library