Skip to content

rescript-react-native/picker

Repository files navigation

BuckleScript bindings to @react-native-community/picker

Build Status Version

These are complete BuckleScript bindings to @reason-react-native/picker, in Reason syntax.

Version x.y.z of @reason-react-native/picker should be compatible with version x.y.* of @react-native-community/picker.

Installation

With yarn:

yarn add @reason-react-native/picker

With npm:

npm install @reason-react-native/picker

@react-native-community/picker should be properly installed and linked. Please refer to the relevant instructions.

@reason-react-native/picker should be added to bs-dependencies in your bsconfig.json. Something like

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

Components

ReactNativePicker Component

Supported on Android and iOS.

Props

Prop Name and Type Notes
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: 'a Value should be that of one of the items.
enabled: bool Android 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: string Android only
Title of the modal dialog when mode is set to `dialog.
itemStyle: ReactNative.Style.t iOS only
Style to be applied to each item label.

Note: only Text style props are supported.

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

ReactNativePickerIOS Component

Supported on iOS.

Props

Prop Name and Type Notes
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: 'a Value should be that of one of the items.
itemStyle: ReactNative.Style.t Style to be applied to each item label.

Note: only Text style props are supported.

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

ReactNativePicker.Item and ReactNativePickerIOS.Item Components

Props

Prop Name and Type Notes
value: 'a Value of the item.
label: string Label for the item in the Picker.
color: ReactNative.Color.t Color of the item label.
testID: string ID string to locate the item in tests.

Changelog

Check the changelog for more informations about recent releases.


Contribute

Read the contribution guidelines before contributing.

Code of Conduct

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

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •