useCheckboxGroup

Provides the behavior and accessibility implementation for a checkbox group component. Checkbox groups allow users to select multiple items from a list of options.

Install#

yarn add @react-native-aria/checkbox

Import#

import {useCheckboxGroup, useCheckboxGroupItem} from '@react-native-aria/checkbox'

API#

useCheckboxGroup(props: AriaCheckboxGroupProps, state: CheckboxGroupState): CheckboxGroupAria
useCheckboxGroupItem(
props: AriaCheckboxGroupItemProps,
state: CheckboxGroupState,
inputRef: RefObject<HTMLInputElement>
): CheckboxAria

AriaCheckboxGroupProps#

CheckboxGroupState#

CheckboxGroupAria#

{
/** Props for the checkbox group wrapper element. */
groupProps: any
/** Props for the checkbox group's visible label (if any). */
labelProps: any
}

AriaCheckboxGroupItemProps#

inputRef#

  • A ref for the HTML or Pressable/Touchable element.

CheckboxAria#

{ inputProps: InputHTMLAttributes<HTMLInputElement> & AccessibilityProps }

Props for the input or Pressable/Touchable element.

Example#

Last updated on by Nishan