CheckboxInput()function
CheckboxInput({
name,
title,
placeholder = title || "Yes",
required = false,
disabled = false,
message = "",
value = false,
onValue,
children,
...variants
}: CheckboxProps): ReactElement| Param | Type | |
|---|---|---|
variants | CheckboxProps | Props for CheckboxInput, a boolean-valued checkbox input. required |
| Return | |
|---|---|
ReactElement | A <label> wrapping the checkbox and its label content. |
Checkbox input bound to a boolean value, rendered as a labelled <input type="checkbox">.
- The label content comes from
children, falling back toplaceholder/title.
Examples
<CheckboxInput name="agree" value={agree} onValue={setAgree}>I agree</CheckboxInput>