rescript-react-native/picker

Repository files navigation

Build StatusVersionReScript Forum

ReScript bindings for @react-native-picker/picker.

Exposed as ReactNativePicker module.

@rescript-react-native/picker X.y.* means it's compatible with @react-native-picker/picker X.y.*

When @react-native-picker/picker is properly installed & configured by following their installation instructions, you can install the bindings:

npm install @rescript-react-native/picker
# or
yarn add @rescript-react-native/picker

@rescript-react-native/picker should be added to bs-dependencies in your bsconfig.json:

{
  //...
  "bs-dependencies": [
    "@rescript/react",
    "rescript-react-native",
    // ...
+    "@rescript-react-native/picker"
  ],
  //...
}

Supported on Android and iOS.

Prop Name and TypeNotes
onValueChange:
('a, int) => unit
Callback for when an item is selected. Takes as arguements item value of any type ('a) and index of the selected item as int.
selectedValue: 'aValue should be that of one of the items.
enabled: boolAndroid only
Making a selection will be disabled when set to false.
mode:
[ | `dialog | `dropdown ]
Android only
Specifies how selection items will be displayed the picker is tapped.

- `dialog: modal dialog (default)
- `dropdown: dropdown anchored to the Picker view.
prompt: stringAndroid only
Title of the modal dialog when mode is set to `dialog.
itemStyle: ReactNative.Style.tiOS only
Style to be applied to each item label.

Note: only Text style props are supported.

Please also see ReScript React Native documentation of View props for additional supported props.

Supported on iOS.

Prop Name and TypeNotes
onValueChange:
('a, int) => unit
Callback for when an item is selected. Takes as arguements item value of any type ('a) and index of the selected item as int.
selectedValue: 'aValue should be that of one of the items.
itemStyle: ReactNative.Style.tStyle to be applied to each item label.

Note: only Text style props are supported.

Please also see ReScript React Native documentation of View props for additional supported props.

Prop Name and TypeNotes
value: 'aValue of the item.
label: stringLabel for the item in the Picker.
color: ReactNative.Color.tColor of the item label.
testID: stringID string to locate the item in tests.

Check the changelog for more informations about recent releases.


Read the contribution guidelines before contributing.

We want this community to be friendly and respectful to each other. Please read our full code of conduct so that you can understand what actions will and will not be tolerated.

About

ReScript bindings for @react-native-community/picker

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •