npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-checkbox-simple

v1.2.1

Published

react-native-checkbox-simple

Downloads

11

Readme

Simple, cross-platform and highly customizable react-native checkbox.

Install with npm

npm i --save react-native-checkbox-simple

Basic Usage

import Checkbox from 'react-native-checkbox-simple';

...

render() {
    return (
        <Checkbox 
          label="Agree to terms and conditions"
          actionCallback={(val)=>alert(val)}  
        />
    )
}

Props

Various props to the checkbox are available module to adjust it to your needs.

Prop | Type | Default | Description | ------------ | ------- | ------- | ----------- | containerStyle | Object | {flexDirection: 'row'} | Changes with flexbox positions of checkbox and label relative to each other(see example below). label | string | "" | Represents the label that by default appears to the right of a checkbox. labelStyle | Object | {fontSize: 14} | Represents the label style. actionCallback | Funcion | na | Represents the callback that return either true or false depending on checkbox's state. isChecked | Boolean | false | Represents the state of the checkbox. internalImgPath | string | na | Accepts imported image(.png) from within the project to be used and checkmark when the checkbox is clicked. externalImgUrl | string | na | Note: overwrites internalImgPath. Accepts a url to an external image(.png). imageStyle | Object | {justifyContent: "center", alignItems: "center", marginRight: 10} | Represents the checkmark image style. unselectedStyle | Object | {width: 20, height: 20, borderColor: '#939598', borderWidth: 2, backgroundColor: "#ddd", borderRadius: 3} | Represents the style of the unchecked checkbox. selectedStyle | Object | {backgroundColor: "#fff", borderColor: '#B9E2A6', width: 20, height: 20} | Represents the style of an active checkbox.

Examples

1. Reverse order of checkbox and label with external image.

<Checkbox 
  label="Example 1"
  actionCallback={(val)=>alert(val)}  
  containerStyle={{flexDirection: "row-reverse", justifyContent: "flex-start" }}
  externalImgUrl="https://d30y9cdsu7xlg0.cloudfront.net/png/835-200.png"
/>

2. Column order of checkbox and label with custom styles for selected state of the checkbox.

<Checkbox 
  label="Example 1"
  actionCallback={(val)=>alert(val)}  
  containerStyle={{flexDirection: "column", alignItems: "center" }}
  selectedStyle={{borderColor: "red"}}
/>

To contribute, please, submit a PR.