AutoForm
Automatically render forms based on a schema.
Props#
Prop | Type | Default | Description |
---|---|---|---|
onSubmitrequired | SubmitHandler<TFieldValues> | The submit handler. | |
children | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode | ((props: FormRenderContext<...>) => ReactNode) | The form children, can be a render prop or a ReactNode. | |
colorScheme | "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" | "primary" | "secondary" | "indigo" | The visual color appearance of the component | |
context | TContext | ||
criteriaMode | CriteriaMode | ||
defaultValues | type ONLY_FOR_FORMAT =
| AsyncDefaultValues<TFieldValues>
| DefaultValues<TFieldValues> | ||
delayError | number | ||
disabled | boolean | ||
errors | FieldErrors<TFieldValues> | ||
fieldResolver | FieldResolver | The field resolver, used to resolve the fields from schemas. | |
fields | DefaultFieldOverrides | Field overrides | |
formRef | RefObject<UseFormReturn<TFieldValues, TContext>> | The Hook Form state ref. | |
mode | "onChange" | "onBlur" | "onSubmit" | "all" | "onTouched" | ||
onChange | WatchObserver<TFieldValues> | Triggers when any of the field change. | |
onError | SubmitErrorHandler<TFieldValues> | Triggers when there are validation errors. | |
progressive | boolean | ||
resetOptions | Partial<{
keepDirtyValues: boolean
keepErrors: boolean
keepDirty: boolean
keepValues: boolean
keepDefaultValues: boolean
keepIsSubmitted: boolean
keepIsSubmitSuccessful: boolean
keepTouched: boolean
keepIsValid: boolean
keepSubmitCount: boolean
}> | ||
resolver | Resolver<TFieldValues, TContext> | ||
reValidateMode | "onChange" | "onBlur" | "onSubmit" | ||
schema | NonNullable<TSchema> | The form schema. | |
shouldFocusError | boolean | ||
shouldUnregister | boolean | ||
shouldUseNativeValidation | boolean | ||
size | string | The size of the Form | |
values | TFieldValues | ||
variant | "horizontal" | The variant of the Form |
Was this helpful?