A React Native bridge around native elegant selection list or dropdown menu
react-native-selection-menu
This library is a React Native bridge around native elegant selection list or dropdown menu for both Android and iOS.
ReactNative: Native Selection Menu (Android/iOS)
iOS
| rushisangani/RSSelectionMenu |
|---|
Android
| Hamadakram/AlertView |
|---|
| Hamadakram/AlertView |
|---|
? Getting started
$ npm install react-native-selection-menu --save
$ 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 verifynode_modules/react-native-selection-menu/ios/containsPodsfolder. If does not exist please executepod installcommand onnode_modules/react-native-selection-menu/ios/, if any error => trypod repo updatethenpod install -
After verification, open your project and create a folder ‘RSSelectionMenu’ under Libraries.
-
Drag
node_modules/react-native-selection-menu/ios/pods/Pods.xcodeprojectinto RNSelectionMenu, as well as the RNSelectionMenu.xcodeproject if it does not exist. -
Add the
RSSelectionMenu.frameworkinto your project’sEmbedded Binariesand make sure the framework is also in linked libraries. -
Go to your project’s
Build Settings -> Frameworks Search Pathand add${BUILT_PRODUCTS_DIR}/RSSelectionMenunon-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 |
|---|---|---|---|
| “ | “ |
Selection
| Single | 0 |
| Multiple | 1 |
Limitation:
Multiple selection is currently not supported on Android