Skip to content

Checkbox

The <Checkbox> component renders an <input type="checkbox"> element where the value prop is bound and which includes all of Formula’s required handlers.

const form = useForm({
initialValues: { isPublic: true }
});
return (
<Checkbox field={form("isPublic")} className="my-checkbox" />
)
function Checkbox(props: {
// The field to associate with this checkbox
field: FormField<boolean>
}
& Omit<DefaultCheckboxProps, "type" | "checked">)

<Checkbox> supports all the values of <input> except for checked (managed automatically) and type (always checkbox).