Skip to Content
APIInterfacesInterface: SimpleFormProps<TFieldValues>

Hero Hook Form API v2.15.0


Hero Hook Form API / SimpleFormProps

Interface: SimpleFormProps<TFieldValues>

Defined in: components/SimpleForm.tsx:15 

Props for the SimpleForm component.

Type Parameters

TFieldValues

TFieldValues extends FieldValues

The form data type

Properties

schema

schema: ZodType<TFieldValues>

Defined in: components/SimpleForm.tsx:17 

Zod schema for validation


field

field: ZodFormFieldConfig<TFieldValues>

Defined in: components/SimpleForm.tsx:19 

Single field configuration


onSubmit()

onSubmit: (data) => void | Promise<void>

Defined in: components/SimpleForm.tsx:21 

Submit handler

Parameters

data

TFieldValues

Returns

void | Promise<void>


submitButton?

optional submitButton: ReactNode

Defined in: components/SimpleForm.tsx:23 

Optional custom submit button


title?

optional title: string

Defined in: components/SimpleForm.tsx:25 

Optional form title


subtitle?

optional subtitle: string

Defined in: components/SimpleForm.tsx:27 

Optional form subtitle


className?

optional className: string

Defined in: components/SimpleForm.tsx:29 

Optional className


defaultValues?

optional defaultValues: DefaultValues<TFieldValues>

Defined in: components/SimpleForm.tsx:31 

Optional default values


onError()?

optional onError: (error) => void

Defined in: components/SimpleForm.tsx:33 

Optional error callback

Parameters

error

FormValidationError

Returns

void


onSuccess()?

optional onSuccess: (data) => void

Defined in: components/SimpleForm.tsx:35 

Optional success callback

Parameters

data

TFieldValues

Returns

void


hideSubmitButton?

optional hideSubmitButton: boolean

Defined in: components/SimpleForm.tsx:37 

Hide default submit button (use custom submitButton instead)