ReactNative component showing tooltip with menu items.
npm install react-native-tooltip-menuCurrently works only with iOS and Android.
Component for specfied case. Left bottom button with nice looking menu tooltip with animation after click.
Via NPM
``bash`
npm install react-native-tooltip-menu
Via yarn
`bash`
yarn add react-native-tooltip-menu
then
`js`
import { TooltipMenu } from 'react-native-tooltip-menu';
| Property | Type | Default | Description |
|---------------------|---------------------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| children | ReactNode | required | |
| items | Array | required | Items to be rendered in menu. Each of item requires label as string or function if you want to render your own component and onPress as function to be called when you click item. |ViewStyle
| style | | Optional | Style Object if you want to overwrite wrapper for your children|Object
| overlayStyle | Object | Optional | Style if you want to overwrite overlay style's.|auto
| widthType | , half or full | auto | Menu items width. auto = automatically set width to your longest test, half = always 50% your screen width, full = 100% screen width.|function
| onRequestClose | | Optional, default () => {} | Modal onRequestClose required function on Android|Object
| labelContainerStyle | | Optional | Style Object if you want to change default TooltipMenuItem View's style.|Object
| labelStyle | | Optional | Style Object if you want to change default TooltipMenuItem Text's style.|Object
| modalButtonStyle | | optional | Style. for TouchabelOpacity when modal is opened.|left
| trianglePosition | , center, right | center | Position of the triangle.|Example
`js
import { TooltipMenu } from 'react-native-tooltip-menu';
const Example = () => (
{
label: 'Label #1',
onPress: () => incrementCounter1()
},
{
label: 'Label #2',
onPress: () => incrementCounter2(),
},
]}
>
backgroundColor: 'purple',
padding: 10,
borderRadius: 25
}}
>
);
``