• Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React Native: Native Selection Menu

PRs Welcome

ReactNative: Native Selection Menu (Android/iOS)

If this project has helped you out, please support us with a star 🌟

This library is a React Native bridge around native elegant selection list or dropdown menu for both Android and iOS.

Limitation: Multiple selection is currently not supported on Android

iOS

rushisangani/RSSelectionMenu

Android

Hamadakram/AlertView
Hamadakram/AlertView

📖 Getting started

$ yarn add react-native-selection-menu --save

RN60 >= RNSM V1 >

RN60 above please use react-native-selection-menu V1 and above

  • iOS

iOS Prerequisite: Please make sure CocoaPods is installed on your system

- Add the following to your `Podfile` -> `ios/Podfile` and run pod update:

  use_native_modules!

  pod 'RNSelectionMenu', :path => '../node_modules/react-native-selection-menu/ios'

  use_frameworks!

  pod 'RSSelectionMenu', :git => 'https://github.com/prscX/RSSelectionMenu.git', :branch => 'react-native'

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name.include?('RSSelectionMenu')
        target.build_configurations.each do |config|
          config.build_settings['SWIFT_VERSION'] = '4.2'
        end
      end
    end
  end

  dynamic_frameworks = ['RSSelectionMenu']
  # Make all the other frameworks into static frameworks by overriding the static_framework? function to return true
  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if !dynamic_frameworks.include?(pod.name)
        def pod.static_framework?;
          true
        end
        def pod.build_type;
          Pod::BuildType.static_library
        end
      end
    end
  end

  • Android

RN60 < RNSM V1 <

RN60 below please use react-native-selection-menu V.0.*

$ react-native link react-native-selection-menu

  • Android
    • Please add below script in your build.gradle
buildscript {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
        ...
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
        ...
    }
}

Note: Android SDK 27 > is supported

  • iOS

    iOS Prerequisite: Please make sure CocoaPods is installed on your system

    • After react-native link react-native-selection-menu, please verify node_modules/react-native-selection-menu/ios/ contains Pods folder. If does not exist please execute pod install command on node_modules/react-native-selection-menu/ios/, if any error => try pod repo update then pod install

    • After verification, open your project and create a folder 'RSSelectionMenu' under Libraries.

    • Drag node_modules/react-native-selection-menu/ios/pods/Pods.xcodeproject into RNSelectionMenu, as well as the RNSelectionMenu.xcodeproject if it does not exist.

    • Add the RSSelectionMenu.framework into your project's Embedded Binaries and make sure the framework is also in linked libraries.

    • Go to your project's Build Settings -> Frameworks Search Path and add ${BUILT_PRODUCTS_DIR}/RSSelectionMenu non-recursive.

    • Now build your iOS app through Xcode

💻 Usage

import { RNSelectionMenu } from 'react-native-selection-menu'
  • Actionsheet: RNSelectionMenu.Actionsheet(props)

  • Alert: RNSelectionMenu.Alert(props)

  • Formsheet: RNSelectionMenu.Formsheet(props)

💡 Props

  • General(iOS & Android)
Prop Type Default Note
values array Specify string array values you want to display for selection
title string Pick your value Specify title of selection menu
onSelection func Specify onSelection callback function
  • iOS
Prop Type Default Note
selectedValues array Specify selected values marked with tick
tickColor string: HEX-COLOR #157efb Specify tick color
actionTitle string Select Specify action title, this appear when selection type is multiple
  • Android
Prop Type Default Note
subtitle string Specify subtitle of menu
theme int Specify theme of selection menu [Light: 0/Dark: 1]
  • Selection
Type Value
Single 0
Multiple 1

Limitation: Multiple selection is currently not supported on Android

  • Presentation Style
Type Value
Actionsheet 0
Alert 1
Formsheet 2
  • Search
Prop Type Default Note
enableSearch bool false Enable/Disable search capability
searchPlaceholder string Search Specify your search placeholder value
searchTintColor: iOS string: HEX-COLOR #d3d3d3 Specify search tint color

Limitation

  • Android: Search is supported only for Formsheet presentation style
  • Formsheet: By default has search capability

Credits

🤔 How to contribute

Have an idea? Found a bug? Please raise to ISSUES. Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

💫 Where is this library used?

If you are using this library in one of your projects, add it in this list below.

📜 License

This library is provided under the Apache 2 License.

RNSelectionMenu @ prscX

💖 Support my projects

I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • Starring and sharing the projects you like 🚀

  • If you're feeling especially charitable, please follow prscX on GitHub.

    Buy Me A Coffee

    Thanks! ❤️
    prscX.github.io
    </ Pranav >

More Repositories

1

react-native-photo-editor

React Native: Native Photo Editor
Java
1,117
star
2

react-native-app-tour

React Native: Native App Tour Library
Objective-C
640
star
3

react-native-bottom-action-sheet

React Native: Native Bottom Action Sheet
JavaScript
634
star
4

react-native-spruce

React Native Bridge for Native Spruce Animation Library
JavaScript
531
star
5

react-native-popover-menu

React Native: Native Popover Menu
JavaScript
482
star
6

awesome-react-native-native-modules

A curated list of Awesome ReactNative: Native Modules Guidelines/Components/News/Tools/Learning Materials
441
star
7

react-native-shine-button

React Native: Native Shine Button - Effects like shining
Java
356
star
8

react-native-file-selector

React Native: Native File Selector
Java
307
star
9

react-native-tooltips

React Native: Native Tooltip View
JavaScript
271
star
10

react-native-iconic

React Native - Native Animated Icons with different states
Java
224
star
11

react-native-fluidic-slider

React Native: Native Fluidic Slider
Objective-C
196
star
12

react-native-styled-dialogs

React Native: Native Styled Dialogs
Objective-C
172
star
13

react-native-morphing-text

React Native: Native Morphing Text
Swift
161
star
14

react-native-toasty

React Native: Native Toast
JavaScript
153
star
15

react-native-siri-wave-view

React Native: Native Siri Wave View
Objective-C
147
star
16

react-native-download-button

React Native: Native Download Button: with pretty cool animation
Java
124
star
17

react-native-lock-screen

React Native: Lock Screen
JavaScript
117
star
18

react-native-voice-recorder

React Native: Native Audio Recorder View
Java
93
star
19

react-native-notification-banner

React Native: Native Notification Banner
JavaScript
90
star
20

react-native-material-shadows

React Native: Native Material Shadows
Java
86
star
21

PXSiriWave9

iOS: Siri Waveform effect similar to 9
Objective-C
65
star
22

react-native-chip-view

React Native: Material Chip View
JavaScript
43
star
23

react-native-number-selector

ReactNative: Native Number Picker
Java
39
star
24

react-native-number-stepper

ReactNative: Number Stepper
JavaScript
35
star
25

react-native-richtext

React Native: Native Rich Text Editor
Swift
32
star
26

prettier-pack

Prettier + ESLint + Husky + Lint + Flow + React + React Native
JavaScript
31
star
27

react-native-about-libraries

React Native: It offers information about install packages
JavaScript
31
star
28

react-native-easy-permissions

React Native: Native Easy Permissions
Objective-C
31
star
29

react-native-file-type

React Native: Detect the file type of a Buffer/Uint8Array by reading from Local Storage
Java
28
star
30

react-native-text-switch

ReactNative: Native Text Switch
Objective-C
26
star
31

vs-essential-plugins

Essential Prepackaged VSCode Plugins for ReactNative
JavaScript
25
star
32

react-native-bottom-sheet-text-view

React Native: Native Bottom Sheet - Text View
Objective-C
22
star
33

PXMultiSelector.iOS

iOS: Multi Selector List
21
star
34

react-native-add-shortcuts

React Native: Native Add Shortcuts
Java
20
star
35

react-native-local-authenticate

React Native: Local Authentication
Java
15
star
36

react-native-image-helper

React Native: Native Image Helper
Java
9
star
37

pod-installer

POD Installer
JavaScript
6
star
38

react-native-whats-new

React Native: Native Whats New Kit
Java
6
star
39

simplified-promise

Enhance Simplicity of JS Promise
JavaScript
4
star
40

BottomSheetTextView.iOS

Android - BottomSheet TextView
Objective-C
2
star
41

BottomSheetTextView.Android

Android - BottomSheet TextView
Java
1
star
42

prscX.github.io

prscX Profile Page
CSS
1
star