beeglebug / react-native-android-checkbox

A React Native checkbox using the stock android widget

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-android-checkbox

A React Native checkbox using the stock android widget

Checkbox Example App

Installation

Install the npm package

npm install --save react-native-android-checkbox

Link the android library

react-native link react-native-android-checkbox

Basic Usage

The checkbox component works in exactly the same way as React.Switch

import React from 'react'
import Checkbox from 'react-native-android-checkbox'

class ExampleComponent extends React.Component {
  constructor() {
    super()
    this.state = {
      value: false
    }
  }

  render() {
    return (
      <Checkbox
        value={this.state.value}
        disabled={false}
        onValueChange={(value) => {
          this.setState({ value })
        }}
      />
    )
  }
}

About

A React Native checkbox using the stock android widget

License:MIT License


Languages

Language:Java 45.1%Language:Objective-C 27.6%Language:JavaScript 17.0%Language:Python 10.3%