Skip to Content
ContentAPIType AliasesType Alias: CheckboxFieldProps<TFieldValues>

Hero Hook Form API v2.5.1


Hero Hook Form API / CheckboxFieldProps

Type Alias: CheckboxFieldProps<TFieldValues>

CheckboxFieldProps<TFieldValues> = FieldBaseProps<TFieldValues, boolean> & WithControl<TFieldValues> & object

Defined in: fields/CheckboxField.tsx:35 

Props for the CheckboxField component.

Type Declaration

checkboxProps?

optional checkboxProps: Omit<React.ComponentProps<typeof Checkbox>, "isSelected" | "onValueChange" | "isInvalid" | "errorMessage" | "isDisabled">

Additional props to pass to the underlying Checkbox component

Type Parameters

TFieldValues

TFieldValues extends FieldValues

The form data type

Example

import { CheckboxField } from "@rachelallyson/hero-hook-form"; import { useForm } from "react-hook-form"; const form = useForm({ defaultValues: { newsletter: false }, }); <CheckboxField control={form.control} name="newsletter" label="Subscribe to newsletter" description="Receive weekly updates" />