Skip to content

rescript-react-native/checkbox

Repository files navigation

@reason-react-native/checkbox

Build Status Version Chat

ReasonML / BuckleScript bindings for @react-native-community/react-native-checkbox.

The module will be exposed as ReactNativeCheckbox.

Version x.y.z of @reason-react-native/checkbox is intended to be compatible with version x.y.z of @react-native-community/react-native-checkbox.

Installation

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

npm install @reason-react-native/checkbox
# or
yarn add @reason-react-native/checkbox

@reason-react-native/checkbox should be added to bs-dependencies in your bsconfig.json. For example,

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

Usage

Types

checkBoxEvent

type checkBoxEvent =
  ReactNative.Event.syntheticEvent({
    .
    "target": int,
    "value": bool,
  });

value represents value of the checkbox as updated by the event.

element

Type to be used in ref and with NativeMethods, as with other components in React Native bindings.

ref

is an alias for React.Ref.t(Js.nullable(element)).

Props

All props are optional.

value: bool

Value of the checkbox. When true, checkbox will be checked. Default value is false.

disabled: bool

When true, user will not be able to toggle the checkbox. Default value is false.

onChange: checkBoxEvent => unit

Returns a native event.

onValueChange

Returns the new bool value.

tintColors

tintColors:
  (~_true: ReactNative.Color.t=?, ~_false: ReactNative.Color.t=?, unit) => tintColors

Value for _true will be used when the checkbox is checked, and value for _false will be used when it is not checked.

View props

Refer to @reason-react-native/react-native documentation.


Changelog

Check the changelog for more information 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/checkbox

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 6