CheckboxField
Checkboxes allow the user to select one or more items from a collection.
View source codeBasic usage
const Demo = () => {
const [checked, setChecked] = useState(false);
return (
<CheckboxField
label="Include receipt"
isChecked={checked}
onChange={(event) => setChecked(event.target.checked)}
/>
);
};
Indeterminate state
Use isIndeterminate
to set the checkbox into an indeterminate state.
<CheckboxField label="Include receipt" isIndeterminate />