Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FormupOptions<Values, State>

Type parameters

  • Values

  • State

Hierarchy

  • FormupOptions

Index

Properties

Optional autocomplete

autocomplete: undefined | string

Set the autocomplete attribute on the form.

Optional classes

Allow to override the used CSS classes.

Optional debounce

debounce: undefined | number

Timeout in milliseconds after which field level validation should start.

If platform is Node.JS this defaults to 0.

defaultvalue

100

Optional dirtyOn

dirtyOn: EventName | EventName[]

Which events should mark a field as FormupContext.dirty.

defaultvalue

FormupOptions.validateOn

Optional getInitialValues

getInitialValues: undefined | ((event?: Event) => Partial<NonNullable<Values>>)

A function called to initialize the form values on creation and reset. The default returns an empty object.

defaultvalue

() => Object.create(null)

Optional onReset

onReset: undefined | ((context: FormupContext<Values, State>, event?: Event) => void)

A function that gets called when form is resetted.

Optional onSubmit

onSubmit: undefined | ((values: Values, context: FormupContext<Values, State>, event?: Event & { submitter?: HTMLButtonElement | HTMLInputElement }) => void | Promise<void>)

A function that gets called when form is submitted successfully. The function receives the values as a parameter.

throws

An thrown error is passed to FormupContext.setFormError.

schema

schema: FormupSchema<Values>

A yup like schema to perform validation.

The object does not have to be yup schema. This allows custom validation without using yup.

Optional state

state: State

A top-level status object that you can use to represent form state that can't otherwise be expressed/stored with other methods.

This is useful for capturing and passing through API responses to your inner component.

defaultvalue

Object.create(null)

Optional validateInitialValues

validateInitialValues: undefined | false | true

Use this option to run validations each time after FormupOptions.getInitialValues has been called.

defaultvalue

false

Optional validateOn

validateOn: EventName | EventName[]

Which events should trigger a validation.

defaultvalue

"change"

Generated using TypeDoc