react-native-bouncy-checkbox-group
Version:
Fully customizable bouncy checkbox group for React Native
41 lines (40 loc) • 1.31 kB
TypeScript
import * as React from "react";
import { StyleProp, ViewStyle } from "react-native";
import { BouncyCheckboxProps } from "react-native-bouncy-checkbox";
export interface CheckboxButton extends Omit<BouncyCheckboxProps, "id"> {
id: string | number;
}
interface BouncyCheckboxGroupProps {
style?: StyleProp<ViewStyle>;
initial?: number | number[] | string | string[];
data: CheckboxButton[];
onChange: (selectedItem: CheckboxButton | CheckboxButton[]) => void;
checkboxProps?: BouncyCheckboxProps;
/**
* Allow multiple checkboxes to be selected simultaneously
* @default false
*/
multiple?: boolean;
/**
* Ensures one checkbox is always selected (works only in single select mode)
* If trying to unselect the only selected item, it will remain selected
* @default false
*/
alwaysSelect?: boolean;
/**
* Custom animation duration for bounce effect
* @default 300
*/
animationDuration?: number;
/**
* Custom spacing between checkboxes
* @default 0
*/
spacing?: number;
/**
* Custom container style for each checkbox
*/
itemContainerStyle?: StyleProp<ViewStyle>;
}
declare const BouncyCheckboxGroup: React.FC<BouncyCheckboxGroupProps>;
export default BouncyCheckboxGroup;