useCheckboxGroup
useCheckboxGroup
is a custom hook that provides all the state management logic
for a group of checkboxes.
Import#
import { useCheckboxGroup } from '@chakra-ui/react'
Return value#
The useCheckboxGroup
hook returns following props
Name | Type | Description |
---|---|---|
value | StringOrNumber[] | The value of checkbox group. |
isDisabled | boolean | A function to set the boolean value to false . |
onChange | (input: EventOrValue) => void | The onChange handler for the checkbox group. |
setValue | (state: StringOrNumber[]) => void | A function to set the value of the checkbox group. |
getCheckboxProps | (props?: Dict) => Dict | A function that takes checkbox props returns them with a onChange handler for the checkbox group and the checked state. |
Usage#
Parameters#
The useCheckboxGroup
hook accepts an object with the following properties: