@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.
43 lines • 1.48 kB
TypeScript
/**
* SwitchGroup
*
* Provides a container for managing a group of Switch components.
* - Maintains an array of selected values for multi-select switches.
* - Passes down context (`SwitchGroupContext`) so individual switches can update and reflect selection.
*
* Author: Geeky Hawks FZE LLC
*/
import React from "react";
import { ViewProps } from "react-native";
/**
* Props for the SwitchGroup component
*
* - **children**: Switch components to render inside the group.
* - **onValueChange**: callback triggered when a switch is toggled.
* - **selectedValues**: currently selected switch values.
*/
export interface SwitchGroupProps extends ViewProps {
/** Switch components to render inside the group */
children: React.ReactNode;
/** Callback triggered when a switch value changes */
onValueChange: (value: string | number, selected: boolean) => void;
/** Array of currently selected switch values */
selectedValues: Array<string | number>;
}
/**
* SwitchGroup
*
* A container that manages a set of Switch components.
* - Provides selected values and change handler through context.
* - Can operate in controlled mode via `selectedValues` prop.
*
* Example:
* ```tsx
* <SwitchGroup selectedValues={selected} onValueChange={setSelected}>
* <Switch value="option1" />
* <Switch value="option2" />
* </SwitchGroup>
* ```
*/
export declare const SwitchGroup: React.FC<SwitchGroupProps>;
//# sourceMappingURL=SwitchGroup.d.ts.map