CheckboxList
Install
yarn add @ntds/checkbox
Import
import { CheckboxList } from '@ntds/checkbox';
Props
CheckboxList
| Prop | Type & Description |
|---|---|
| name | string The name of the Checkbox. |
| value | string[] The current state of the checkboxesc |
| setValue | (value: string[]) => void Pass your setter from useState() directly here. |
| horizontal | boolean If the CheckboxList should be displayed horizontally |
| errorMessage | string | ((id: string) => ReactNode) Mark the input as invalid both visually and semantically Given as a |
| hasError | boolean Toggle an errormessage below the CheckboxList |
| onChange | (event: ChangeEvent<HTMLInputElement>) => void A callback that gets triggered when a checkbox is clicked |
| children | ReactNode Usually simple text, but can be anything |