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-native-bouncy-checkbox-group

v2.0.0

Published

Fully customizable bouncy checkbox group for React Native

Readme

React Native Bouncy Checkbox Group

A fully customizable, animated checkbox group component for React Native applications.

react-native-bouncy-checkbox-group.gif

Features

  • Single and multiple selection support
  • "Always selected" mode to ensure one option is always chosen
  • Horizontal and vertical layouts
  • Customizable animations and spacing
  • TypeScript support
  • Flexible styling options
  • Bouncy animation effects

Installation

npm install react-native-bouncy-checkbox-group
# or
yarn add react-native-bouncy-checkbox-group

This package requires react-native-bouncy-checkbox version 4.1.2 or higher. If you haven't installed it yet:

npm install react-native-bouncy-checkbox@latest
# or
yarn add react-native-bouncy-checkbox@latest

Usage

Basic Usage

import BouncyCheckboxGroup, { CheckboxItem } from 'react-native-bouncy-checkbox-group';

const data = [
  {
    id: 0,
    text: 'Option 1',
    fillColor: '#ff7473',
    unfillColor: '#fbbfbb',
  },
  {
    id: 1,
    text: 'Option 2',
    fillColor: '#5567e9',
    unfillColor: '#afb5f5',
  },
];

// Inside your component
<BouncyCheckboxGroup
  data={data}
  onChange={(selectedItem) => {
    console.log('Selected:', selectedItem);
  }}
/>

Single Selection with Initial Value

<BouncyCheckboxGroup
  data={data}
  initial={0} // Set initial selection to item with id=0
  spacing={8} // Add spacing between items
  onChange={(selectedItem) => {
    console.log('Selected:', selectedItem);
  }}
/>

Always Selected Mode

The alwaysSelect feature ensures that one checkbox must always be selected in single selection mode. This is useful for cases where having no selection is not a valid state, like radio button groups.

<BouncyCheckboxGroup
  data={data}
  initial={0} // Set initial selection
  alwaysSelect={true} // Prevent deselection of the selected item
  onChange={(selectedItem) => {
    console.log('Selected:', selectedItem);
  }}
/>

With alwaysSelect enabled:

  • One checkbox is always selected
  • Users can change selection by tapping a different checkbox
  • Attempting to deselect the currently selected checkbox has no effect
  • If no initial value is set, the first item is automatically selected

Multiple Selection

Enable choosing multiple options simultaneously:

<BouncyCheckboxGroup
  data={data}
  multiple={true} // Enable multiple selection
  initial={[0, 2]} // Optional initial selections
  onChange={(selectedItems) => {
    console.log('Selected:', selectedItems);
  }}
/>

Vertical Layout

Change the orientation to vertical:

<BouncyCheckboxGroup
  data={data}
  style={{ flexDirection: 'column' }}
  onChange={(selectedItem) => {
    console.log('Selected:', selectedItem);
  }}
/>

Customizing Animation and Spacing

<BouncyCheckboxGroup
  data={data}
  animationDuration={100} // Faster animation (default: 300ms)
  spacing={12} // Add 12 pixels between checkboxes
  onChange={(selectedItem) => {
    console.log('Selected:', selectedItem);
  }}
/>

Custom Styling for Individual Checkboxes

The data array accepts all properties from the react-native-bouncy-checkbox package:

const customData = [
  {
    id: 0,
    text: 'Custom Option',
    fillColor: '#ff7473',
    unfillColor: '#ffffff',
    textStyle: { 
      textDecorationLine: 'none', 
      fontSize: 16,
      color: '#333'
    },
    iconStyle: { 
      borderRadius: 8,
      borderColor: '#ff7473'
    },
    size: 24
  },
  // More items...
];

Using External State Management

If you need to control the checkbox state from outside, you can use the useBuiltInState prop in your checkbox items:

const [myState, setMyState] = useState(false);

const customData = [
  {
    id: 0,
    text: 'Externally Controlled',
    isChecked: myState,
    useBuiltInState: false, // Disable internal state management
    onPress: (checked) => {
      setMyState(!myState); // Update your own state
    }
  },
  // More items...
];

Props

BouncyCheckboxGroup Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | CheckboxItem[] | Required | Array of checkbox items | | onChange | (selectedItem: CheckboxItem \| CheckboxItem[]) => void | Required | Callback when selection changes | | style | StyleProp<ViewStyle> | undefined | Container style | | initial | SelectionID \| SelectionID[] | undefined | Initial selected item(s) by ID | | multiple | boolean | false | Enable multiple selection | | alwaysSelect | boolean | false | Ensures one checkbox is always selected (single select mode only) | | animationDuration | number | 300 | Duration of bounce animation in ms | | spacing | number | 0 | Spacing between checkbox items | | itemContainerStyle | StyleProp<ViewStyle> | undefined | Style for each checkbox container | | checkboxProps | BouncyCheckboxProps | undefined | Props applied to all checkboxes |

CheckboxItem Props

The CheckboxItem interface extends all props from react-native-bouncy-checkbox with an added required id field:

| Prop | Type | Default | Description | |------|------|---------|-------------| | id | string \| number | Required | Unique identifier for the checkbox | | text | string | undefined | Text label for the checkbox | | isChecked | boolean | undefined | Control the checked state externally | | useBuiltInState | boolean | true | Set to false to manually control checkbox state | | fillColor | string | #f09f48 | Color when checked | | unfillColor | string | transparent | Color when unchecked | | textStyle | StyleProp<TextStyle> | Default | Style for the text label | | iconStyle | StyleProp<ViewStyle> | Default | Style for the checkbox icon | | ... | ... | ... | All other props from BouncyCheckbox |

Example

Check out the example folder for a fully working demo app that demonstrates all features.

License

MIT