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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-form-checkbox

v0.2.0

Published

Checkboxes handled with React

Readme

react-form-checkbox

A component to correctly handle checkboxes, with added support for Redux Form

install

npm install react-form-checkbox

Examples

Simple checkbox group with a simple array.

Both value and label are based on the array items.


<Checkboxes data={['red', 'white', 'blue']} onChange={/* your handler*/} />

The onChange has to be a function, the first argument will be the selected options.

Custom item rendering

You can have full control of the checkbox html.

If you want an à la bootstrap rendering, create a new Component and add it to the itemComponent property.


const bootstrapParser = ({input, label}) => (
    <div className="checkbox">
        <label>
            <input type="checkbox" {...input} />
            {label}
        </label>
    </div>
);

<Checkboxes data={['red', 'white', 'blue']} itemComponent={bootstrapParser} />

Advanced data

An array with objects can also be passed.


let options = [
  {label: 'Monday', value: 'monday'},
  {label: 'Tuesday', value: 'tuesday'},
  {label: 'Wednesday', value: 'wednesday'},
  {label: 'Thursday', value: 'thursday'},
  {label: 'Friday', value: 'friday'},
  {label: 'Saturday', value: 'saturday'},
  {label: 'Sunday', value: 'sunday'}
];

<Checkboxes data={options} />

By default, it will search for the label key to use as a label, and for the value key to use as a value.

To overwrite that, use the labelField or valueField property to define your own.


let options = [
  {text: 'Monday', option: 'monday'},
  {text: 'Tuesday', option: 'tuesday'},
  {text: 'Wednesday', option: 'wednesday'},
  {text: 'Thursday', option: 'thursday'},
  {text: 'Friday', option: 'friday'},
  {text: 'Saturday', option: 'saturday'},
  {text: 'Sunday', option: 'sunday'}
];

<Checkboxes data={options} labelField="text" valueField="option" />

Form Redux implementation

We created a simple HOC for Form Redux.


import { ReduxCheckbox, Checkboxes } from 'react-form-checkbox';

<Field component={ReduxCheckbox(Checkboxes)} data={['red', 'white', 'blue']} />

Every option can be passed to the Form Redux's Field component and will be proxied to the Checkboxes.

Contribute

Do you want to contribute by creating bugs, fixing them or adding new features? Read the instructions