react-native-panorah-customdropdown
v1.0.0
Published
this is custom dropdown for bulk actions
Downloads
6
Readme
CustomDropdownMenu Component
The CustomDropdownMenu
is a customizable dropdown menu component for React Native applications that allows for dynamic display of options. The menu can be toggled with a button, and clicking an option triggers a specified function. It is designed to be simple, flexible, and easily integrated into any React Native project.
Installation
To use this component in your project, you need to have react-native-vector-icons
installed:
```bash
npm install react-native-vector-icons
Props The CustomDropdownMenu component accepts the following props:
Prop Type Description options Option[] An array of options for the dropdown. Each option should have a label and function_name. onPress (option: Option) => void Function to be called when an option is selected. The selected option is passed as an argument.
const options = [ { label: 'Profile', function_name: 'goToProfile' }, { label: 'Settings', function_name: 'openSettings' }, { label: 'Logout', function_name: 'handleLogout' } ];
const handleOptionPress = (option) => { console.log('Selected Option:', option); // Add your custom logic for each option };
// Inside your component render method