Giter Site home page Giter Site logo

react-native-item-checkbox's Introduction

react-native-item-checkbox

Create your own item checkbox with custom colors.

Getting started

npm i react-native-item-checkbox

!IMPORTANT only works with react-native-vector-items now Don't forget to run rnpm link

Basic usage

This basic line will generate a standard checkbox with a 'check' symbol for you.

Options

Option default value values
onCheck (PropTypes.func) function that alerts 'implement me' callback function
onUncheck (PropTypes.func) function that alerts 'implement me' callback function
icon (PropTypes.String) 'check' any FontAwesome icon you find here
size (PropTypes.number) 18 the size of your checkbox button
backgroundColor (PropTypes.String) 'grey' colors
color (PropTypes.String) 'white' colors
iconSize (PropTypes.String) 'normal' {'small', 'normal', 'large'}
checked (PropTypes.bool) false {true, false} (calles onCheck or onUncheck)
default (PropTypes.bool) false {true, false} (doesn't call onCheck or onUncheck)
style (PropTypes.func) null custom style

Examples

var ItemCheckbox = require('react-native-item-checkbox');

// inside your render function
<ItemCheckbox /> // 

Gif

// ...
_onCheckCallback: function() {
  alert('checked');
},
// ...
<ItemCheckbox //example with callbacks
  onCheck={this._onCheckCallback}
/>
<ItemCheckbox //example with icon settings
  color="#FF9999"
  icon="tree"
  iconSize="normal" //"small", "normal", "large"
  size={100}
/>

Gif

iconSize

Gif

iconSize={"small", "normal", "large"}

react-native-item-checkbox's People

Contributors

aroth avatar techmentormaria avatar theotheo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-item-checkbox's Issues

passing object to _onCheckCallback doesnt work

Hi Maria,
I've been trying to able to get the list of selected checkboxes using this component , however i found that if I try to pass this._onCheckCallback('checkbox1') and try to log or alert it, it always shows undefined. I need to find a way to identify which checkbox being selected, is there any alternative way of doing it?

Add the default props, but not the checked props.

In my case, I render the checkbox by a state which decide the checkbox is checked or unchecked.

But where the state is true(if true means checked), it will call the onChecked function.

So I wonder if has a default props like the checked props, but it will not call the onChecked function is good

render problem

My check boxes are rendering like this:

screen shot 2016-02-24 at 01 11 22

I can't get any icon to appear, only a red box!? Any idea what I've done wrong? I've got react-native-vector-icons/FontAwesome imported.

          <ItemCheckbox
            color={CS.lightGrey}
            iconSize="small"
            size={16}
          />

getting propType Warnings

I tried it on RN0.24 but keeps giving me these two:
Failed propType warning: Invalid prop.style key 'color' supplied to 'View'
Failed propType warning: Invalid prop.style key 'color' supplied to 'RTCView'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.