Skip to main content

onChange

Description

Fires when the checkboxes are selected

Usage

onChange?: (ev: { value: (string | number)[] }) => void;

Parameters

The callback of the event takes an object with the following parameter:

  • value - (array) an array of ids of the selected checkboxes

Example

function handleChange({ value }: { value: (string | number)[] }) {
console.log(value);
}

<CheckboxGroup onChange={handleChange} />

Details

The handler function receives an object with an array of ids of the selected checkboxes.