Interface ToggleSchema

Hierarchy

  • BaseFieldSchema
  • Pick<ToggleFieldProps, "label" | "placeholder" | "readOnly" | "defaultValue">
    • ToggleSchema

Properties

disabled?: boolean | FormFieldPredicate
hidden?: boolean | FormFieldPredicate
name: string

Name of the property in the result data.

props?: Omit<ToggleFieldProps, "required">

Additional custom props for the field component like: label.

type: "toggle"

The type of form field used to edit this value.

validation?: BooleanValidation

A list of validation rules for this field.

Remarks

Rules are AND, so all of them must pass, for the field to be valid. Rules are tested in order, until one fails. Fields can only display one error, so earlier rules have priority over later ones. As a guideline, wide, general rules like required should come before narrower, more detailed ones, like pattern.

Example

validation: {type: 'number', rules: [
{type: 'required'},
{type: 'min', params: [0, 'Must be positive']},
]},

Generated using TypeDoc