@geekyhawks/react-native-ui-components
Version:
A lightweight and reusable React Native UI components library with customizable Text, TextInput, FloatingLabelTextInput, Button, and more. Built with TypeScript, fully typed, and designed for easy integration into any React Native project.
39 lines • 1.49 kB
TypeScript
/**
* CheckBoxContext
*
* Provides a React Context for managing checkbox groups.
* - Stores the array of currently selected values.
* - Exposes a callback to update the selected values.
* - Used internally by `CheckBoxGroup` and consumed by individual `CheckBox` components
* via the `useCheckBoxGroupContext` hook.
*
* Author: Geeky Hawks FZE LLC
*/
import React from "react";
/**
* Shape of the checkbox group context value.
* - **onValueChange**: callback to update the selected values when a checkbox is toggled.
* - **selectedValues**: array of currently selected checkbox values.
*/
export interface CheckBoxGroupContextType {
/**
* Callback to update the selected values
* @param vals - new array of selected values
*/
onValueChange: (vals: Array<string | number>) => void;
/** Array of currently selected checkbox values */
selectedValues: Array<string | number>;
}
/**
* React Context for managing checkbox group state.
* Provides `selectedValues` and `onValueChange` to nested `CheckBox` components.
*/
export declare const CheckBoxGroupContext: React.Context<CheckBoxGroupContextType>;
/**
* Hook to access the current `CheckBoxGroupContext`.
* Should only be used inside components wrapped by a `CheckBoxGroup`.
*
* @returns The current checkbox group context or `null` if not inside a group.
*/
export declare const useCheckBoxGroupContext: () => CheckBoxGroupContextType;
//# sourceMappingURL=CheckBoxContext.d.ts.map