Skip to Content
APIType AliasesType Alias: CheckboxFieldProps<TFieldValues>

Hero Hook Form API v2.15.0


Hero Hook Form API / CheckboxFieldProps

Type Alias: CheckboxFieldProps<TFieldValues>

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

Defined in: fields/CheckboxField.tsx:40 

Props for the CheckboxField component.

Type Declaration

checkboxProps?

optional checkboxProps: CheckboxPassthroughProps

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" />