🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

@freakycoder/react-native-picker-modal

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@freakycoder/react-native-picker-modal

Easy and fully customizable picker modal for React Native.

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
98
55.56%
Maintainers
1
Weekly downloads
 
Created
Source
React Native Picker Modal

Battle Tested ✅

React Native Picker Modal

npm version npm Platform - Android and iOS License: MIT styled with prettier

React Native Picker Modal

Installation

Add the dependency:

npm i react-native-picker-modal

Peer Dependencies

IMPORTANT! You need install them
"react-native-modal": ">= 13.0.0"

Usage

Import

import PickerModal from "@freakycoder/react-native-picker-modal";

Fundamental Usage

<PickerModal
  title="You can either take a picture or select one from your album."
  isVisible={isVisible}
  data={["Take a photo", "Select from album"]}
  onPress={(selectedItem: string, index: number) => {
    console.log({ selectedItem, index });
  }}
  onCancelPress={() => {
    setVisible(false);
  }}
  onBackdropPress={() => {
    setVisible(false);
  }}
/>

Example Project 😍

You can checkout the example project 🥰

Simply run

npm i
react-native run-ios/android

should work of the example project.

Configuration - Props

Fundamentals [Required]

PropertyTypeDefaultDescription
titlestringundefinedchange the title
datastring[]undefinedset the picker modal dataset as string array
isVisiblebooleanundefinedchange the picker modal visibility
onPressfunctionundefinedset your own logic for the button functionality when it is pressed
onCancelPressfunctionundefinedset your own logic for the cancel button functionality when it is pressed

Customization (Optionals)

PropertyTypeDefaultDescription
onBackdropPressfunctionundefinedset your own logic for the backdrop of the modal functionality when it is pressed
TouchableComponentTouchableHightlightdefaultset your own component instead of default react-native TouchableHightlight component
styleViewStyledefaultset or override the style object for the main container
dividerStyleViewStyledefaultset or override the style object for the divider style
cancelButtonStyleViewStyledefaultset or override the style object for the cancel button style
titleTextContainerViewStyledefaultset or override the style object for the title text container
titleTextStyleTextStyledefaultset or override the style object for the title text style
cancelButtonTextStyleViewStyledefaultset or override the style object for the cancel button text container
actionButtonStyleViewStyledefaultset or override the style object for the action button container
actionButtonTextStyleViewStyledefaultset or override the style object for the action button text
actionButtonUnderlayColorstringrgba(0,0,0,0.3)change the action button's underlay color
cancelButtonUnderlayColorstringrgba(200,200,200,0.1)change the cancel button's underlay color

Future Plans

  • LICENSE
  • Write an article about the lib on Medium

Author

FreakyCoder, kurayogun@gmail.com

License

React Native Picker Modal is available under the MIT license. See the LICENSE file for more info.

Keywords

FreakyCoder

FAQs

Package last updated on 05 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts